A Microsoft Power BI Custom Connector for importing Trino data into Power BI to interactively transform, visualize and analyze data.
The connector communicates directly with the Trino client REST API to retrieve data and provides some pararmeters to configure. Client timeout errors (ABANDONED_QUERY) can be fixed by changing the value of query.client.timeout in the coordinators config.properties file (the default is 5 minutes).
The supported authentication kinds are Anonymous, Basic (UsernamePassword) and OAuth.
In case you encounter any issues while installing or loading data, just open an issue or feel free to reach out to one of the contributors of this repository.
If you want to customize the connector or to use OAuth, you will need to build a .mez file yourself by following this step-by-step guide. Otherwise, for just using the connector, you can go right to step 6.
-
Install Visual Studio Code and the Power Query SDK extension.
-
Clone this repository and open the folder
Trino
in Visual Studio Code. (If you open the main folder of this repository, then the Power Query SDK extension won't recognise it as an extension project.) -
(Optional) Modify the file
Trino.pq
as needed, for OAuth in particular the functionTokenMethod
. The currentTrino.pq
has been written for OAuth using AWS Cognito, but your particular use case may well require a different protocol. See the official documentation for more information. This post is also helpful. Note that changes made toTrino.pq
may affect which files need to be created in the next step. -
(Optional) For OAuth various files need to be created to store the configuration of your setup. The all begin with the prefix
oauth_config_
, which is included in.gitignore
to guard against unintenionally committing credentials.-
oauth_config_client_id.txt
This should contain your application's Client ID. Don't commit this. -
oauth_config_client_secret.txt
This should contain your application's Client Secret. Really don't commit this. -
oauth_config_authorize_uri.txt
This should contain the URI of your authorize-endpoint. An example:https://<your-app>.auth.<aws-region>.amazoncognito.com/oauth2/authorize
-
oauth_config_scopes.txt
This should contain the OAuth scopes. An example:openid
Remark: It should be possible to include more than one scope (space- or comma-seprated?), but this has not been tested.
-
oauth_config_token_uri.txt.txt
This should contain the URI of your token-endpoint. An example:https://<your-app>.auth.<aws-region>.amazoncognito.com/oauth2/token
This information is included in
.gitignore
to not commit it into this public repo. -
-
The .mez file now needs to be built. In the Command Palette, select "Tasks: Run Build Task" (type "> b" to find it):
Then select the option to use MakePQX:
If all goes well, the file
Trino.mez
should appear in the folderTrino\\bin\\AnyCPU\\Debug
. -
Take the pre-built .mez from this link or if customized from your debug folder and place it in your local
Documents\Power BI Desktop\Custom Connectors
folder, as outlined in the documentation. Once done, you should be able to see the connector listed in your "Get Data" window, restart Power BI Desktop in case it doesn't appear: -
Populate the required and optional fields to communicate with your Trino environment and hit OK to either scan your objects or to execute a specific SQL query if provided:
-
Choose the desired authentication mechanism:
-
Choose the desired objects you want to import and click "Load" if you want to import data directly. Clicking "Transform Data" allows you to transform data before actually importing it into the analytical storage engine:
To support end-to-end refresh through the Power BI Service on the cloud, it requires you to setup an on-premise data gateway. Once the connector is officially supported, this is not required anymore.
April 2024
- 2024-04-04: Optimizing data type conversion for date and time
February 2024
- 2024-02-07: Native SQL Query parameter added
April 2023
- 2023-04-26: OAuth added
October 2021
- 2021-10-15: First Release