Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
ODBC: Use literals instead of parameters in Power BI data connector (#…
Browse files Browse the repository at this point in the history
…652)

* pbi connector

* update names

* - add mez file
- add docs

* nit

* nit

* image resize

* resize image

* remove extra lines

* nit

* update mez file

* rename connector

* rename mez file

* - add basic & aws auth
- add unit test
- add errors
- enable direct query

* add connector

* update doc

* add ssl for auth

* update docs for errors

* - remove sqlgetinfo & sqlcapabilities values from connector

* adding EncryptedConnectionString

* add data type for columns

* add alternate column size

* reverting changes in catalog test

* nit

* revert changes for column size validation

* address PR comments

* Update SQL_GROUP_BY value for fixing query folding issue

* removing AstVisitor for resolving query folding issue with data type boolean

* fix parameter binding issue

* simplify changes

* update user doc for pbi
  • Loading branch information
rupal-bq authored Aug 3, 2020
1 parent a9f027d commit b6760cc
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sql-odbc/docs/user/img/pbi_simple_graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions sql-odbc/docs/user/power_bi_support.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Connecting Open Distro For ElasticSearch to Microsoft Power BI Desktop

**NOTE**: **The connector is under development. All connection options are not available yet. There could be issues while loading data**

## Prerequisites
* Microsoft Power BI Desktop
* [Open Distro for Elasticsearch](https://opendistro.github.io/for-elasticsearch-docs/docs/install/)
Expand All @@ -19,7 +17,14 @@

## Load Data

> **NOTE**: Currently only import mode is supported. Direct query support will be added soon.
* Open Power BI Desktop.

* Disable parallel loading of tables. Click on **Files** > **Options and settings** > **Options** > **CURRENT FILE** > **Data Load** > Deselect **Enable parallel loading of tables** and click **OK**.

<img src="img/pbi_disable_parallel_loading_tables.png" width="500">

* Click on **Home** > **Get Data** > **More** > **Other**. Select **Open Distro For Elasticsearch (Beta)**. Click on **Connect**.

<img src="img/pbi_select_connector.png" width="500">
Expand All @@ -42,6 +47,10 @@

* Click on **Load**.

* Select required columns for creating graph.

<img src="img/pbi_simple_graph.png">

## Troubleshooting

* If you get an following error, please install [Open Distro For Elasticsearch SQL ODBC Driver](https://opendistro.github.io/for-elasticsearch-docs/docs/sql/odbc/).
Expand Down
21 changes: 20 additions & 1 deletion sql-odbc/src/PowerBIConnector/OdfeSqlOdbcPBIConnector.pq
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ OdfeSqlOdbcPBIConnectorImpl = (Host as text, optional Port as number) as table =
Value.ReplaceType(toTable, Value.Type(source))
else
source,

SQLGetFunctions = Diagnostics.LogValue("SQLGetFunctions_Options", [
SQL_API_SQLBINDPARAMETER = false
]),

SqlCapabilities = Diagnostics.LogValue("SqlCapabilities_Options", [
SupportsTop = false,
LimitClauseKind = LimitClauseKind.LimitOffset,
SupportsNumericLiterals = true,
SupportsStringLiterals = true,
SupportsOdbcDateLiterals = true,
SupportsOdbcTimeLiterals = true,
SupportsOdbcTimestampLiterals = true
]),

OdbcDatasource = Odbc.DataSource(ConnectionString & Server & CredentialConnectionString & EncryptedConnectionString, [
// Do not view the tables grouped by their schema names.
Expand All @@ -123,6 +137,8 @@ OdfeSqlOdbcPBIConnectorImpl = (Host as text, optional Port as number) as table =
SQLColumns = SQLColumns,
SQLGetTypeInfo = SQLGetTypeInfo,
SQLGetInfo = SQLGetInfo,
SQLGetFunctions = SQLGetFunctions,
SqlCapabilities = SqlCapabilities,

OnError = OnOdbcError,

Expand Down Expand Up @@ -191,7 +207,10 @@ OdfeSqlOdbcPBIConnector.Publish = [
Category = "Other",
ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") },
LearnMoreUrl = "https://opendistro.github.io/for-elasticsearch/",
SupportsDirectQuery = true,

// Disabling direct query due to limited SQL query support
SupportsDirectQuery = false,

SourceImage = OdfeSqlOdbcPBIConnector.Icons,
SourceTypeImage = OdfeSqlOdbcPBIConnector.Icons
];
Expand Down
Binary file not shown.

0 comments on commit b6760cc

Please sign in to comment.