Google Data Studio - Use of User Defined Functions (UDFs) - user-defined-functions

Basic Question: Does Google Data Studio allow calling a SQL User Defined Function (UDF) within a Custom Query data source?
My UDF works great in BigQuery. The exact same code (SQL call to a UDF) fails when creating a report to leverage this data source/code.
The following error is encountered:
Data Set Configuration Error Data Studio cannot connect to your data set.
Failed to fetch data from the underlying data set
Error ID: 53979666

+1 to the question, looking for a better solution, too.
My current walkaround is far from ideal, but perhaps could be good enough for someone:
scheduled query that executes and materialises data
datastudio on top of table created in step 1

Though you can't create a user-defined function in a Data Studio custom query, you can define a UDF in BigQuery and use it in the custom query.
Source: https://www.anvilinsights.com/video/user-defined-functions-udf-in-custom-query

Related

PBI - Direct Query and Oracle table function

Currently having to transfer some existing reports in Cognos into PBI, we have some challenges:
We would need to use direct query + a table function, else we need to redesign everything on DB side, which is not expected.
The main challenge here is that it seems that we are not able to pass dynamically to the query any parameter (like a user's choice or "slicer"), and not even the username of who is currently running the report.
Is there any solution for this?
Any improvement planned in the future in PBI?
Thanks!
Vinc

Query to read data from URL

I am using Greenplum Database.
Need to write query or may be function to read data from a URL.
Say a sharepoint URL is there, which contains some tabular data.
I need to write a query to fetch that Data from within the sql query or function.
I can get http_get, but its not helpful because the version is 8.2x.
I also tried python as pg language, it is also not working as it is listed as untrusted language. Hence looking for some alternative.
Have you tried using web external tables:
https://gpdb.docs.pivotal.io/5170/admin_guide/external/g-creating-and-using-web-external-tables.html

Data redaction by oracle

In my current project i have a challenge regarding data redaction. we do not get data from Client because they have sensitive information in some of the columns. So to get the data from them we decided to encrypt the data and then it will come to us.
I am struggling to find an inbuilt algorithm in oracle which encrypt the data. One of the main objective of mine is:
1.) Length of my original input should remain the same after data redaction.
2.) Data type of my original input should remain after data redaction.
Can you please give me your input to achieve this.
Thanks and Regards
Ankit.
There are various options to encrypt your data, you can build your own PLSQL procedures using the DBMS_CRYPTO builtin package.
https://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_crypto.htm#ARPLS65670
Or if you use Enterprise Edition of oracle:
transparent data encryption:
https://docs.oracle.com/cd/E11882_01/network.112/e40393/asotrans.htm#ASOAG600
and if you have 12c, you can use Oracle Data Redaction:
http://www.oracle.com/technetwork/articles/database/data-redaction-odb12c-2331480.html
The advantage of the last one is that the data is not touched inside the database, Oracle Data Redaction acts as an upper layer masking data on the fly before it is returned to the application.

BIRT Scripted Data Source using existing JDBC DataSource

I know that my overall problem is generally approached using two of the more common solutions such as a join data set or a sub-table, sub-report. I have looked at those and I am not sure this will work effectively.
Background:
JDBC data source has local data which includes a series of id's that reference a record in a master data repository interfaced via a web service. This is where the need for a scripted data source arises. The data can be filtered on either attributes within the local JDBC data and/or the extended data from the web service. The complication is that my only interface is the id argument to the webservice.
Ideal Solution:
Aside from creating a reporting table or other truly desirable scenarios I am looking to creating a unified data source through a single scripting data source that will handle all the complexities. This leaves the report generation and parameter creation a bit cleaner, hopefully. The idea is to leverage the JDBC query as well as the web service queries in the scripted data source do the filtering and joins and create that singular unified view.
I tried using the following code as a reference to use the existing JDBC connection in the BIRT report definition to execute the query. However if I think my breakdown on what should be in open vs fetch given this came from beforeFactory for a completely different purpose may be giving me errors...truth is I see no errors it just returns 0 records.
a link
I have also found a code snippet to dynamically load a JDBC connection but that seems a bit obtuse and a ton of overhead for what I am needing to do. a link
In short: How in all-that-is-holy do you simply run a query against a database within a scripted data source if you wanted to do. The merit of doing that is another issue, but technically how?
Thanks in Advance!

How to write an Oracle stored procedure that can be used by the Telerik report wizard?

I looked online for this information and I couldn't find too much.
How do I write a stored procedure that returns the results of a SELECT statement to a Telerik report? It is pretty simple to this with SQL Server, but I know have to use a ref cursor in Oracle.
I found an article on how to do it for Crystal Reports and thought it might be similar but it didn't work for me and I get the following error:
Any guidance/advice would be greatly appreciated. Thanks!
Instead of binding directly to the results of your stored proc, try making the call from a class that pushes the data into a Data Model. Create a method/property to expose that data and then use the telerik wizard to bind to the results of the method call using the Telerik implementation of ObjectDataSource. It looks like your problem is being caused by telerik trying to guess how to convert your data.

Resources