sgoley / DirectQuery-for-ODBC-in-PowerBI

Direct Query for PostgreSQL via ODBC with SSL
MIT License
14 stars 9 forks source link

PostgreSQL Major: "OLE DB or ODBC error: [Expression.Error] We couldn't fold the expression to the data source. Please try a simpler expression.." #1

Closed sgoley closed 5 years ago

sgoley commented 5 years ago

image

sgoley commented 5 years ago

Four common folding errors:

1) "Data Type of column order_status with searchable property UNSEARCHABLE should be SEARCHABLE or ALL_EXCEPT_LIKE." = Text column not being recognized as searchable (One of my proprietary text columns which didn't get correctly cast to WLONGVARCHAR) (ex. sort functions)

2) "This ODBC driver doesn't support SQL_FN_TD_TIMESTAMPDIFF. You can override this by using SqlGetInfo for SQL_TIMEDATE_FUNCTIONS." = Date column that is being cast to Timestamp for an odd reason and so Date math cannot be applied. (ex. date filters)

3) "This ODBC Driver does not support SQL_GB_NO_RELATION. You can override this by using SqlCapabilities" = Driver does not support the highest level of Group By Requirements, has to be set in custom driver as another one of these values: SQL_GB_NOT_SUPPORTED = 0, SQL_GB_GROUP_BY_EQUALS_SELECT = 1, SQL_GB_GROUP_BY_CONTAINS_SELECT = 2, SQL_GB_NO_RELATION = 3, SQL_GB_COLLATE = 4 (ex. group numeric by name)

4) "This ODBC driver doesn't support SQL_AF_SUM. You can override this by using SqlGetInfo for SQL_AGGREGATE_FUNCTIONS" = Flag not set to allow standard aggregate functions / not picked up in Sql92Conformity parameter. (ex. any numeric "default summarizations")

Currently 1 & 2 are outstanding.

sgoley commented 5 years ago
  1. Text search on directquery does not work.

Make a slicer which has a text search function based on a field in a directquery table and then search for values:

image

dr0rRvali commented 5 years ago

@sgoley hey, first of all, thank you for you hard work.

im trying to understand how to resolve the "try simpler expression" but i dont know how.

is that fixable at all?

thanks

sgoley commented 5 years ago

@dr0rRvali Oh no problem! I just realized how needed it was after I found there really was no answer on this available.

For your situation - would you mind answering a few questions?

dr0rRvali commented 5 years ago

@sgoley

sure, thank you for your answer!!

Database: MySql Community Edition ODBC Driver: MySql ODBC 8.0 Unicode Driver DataType Field: Int Visual: Table

Decsription: when i drag the int column it is ok (but it is sum aggregated by deafult), but when i check the "dont summerize" in power bi i get that error.

i cant see anything that is not aggregated.

sgoley commented 5 years ago

@dr0rRvali,

Ok this existing version is currently focused on PostgreSQL. There was someone else who contacted me about a similar issue using SQL Server and we had to make a fork of the project to handle some of those cases. I'm guessing this is going to be similar for MySQL. Does the existing MySQL integration not support DirectQuery?

I won't promise anything but I'll move this to a new issue for MySQL compatibility.

dr0rRvali commented 5 years ago

@sgoley you are right. the existing mysql integration is not supporting direct query (why did he want this to sql if it is supported for DC?? out of curiosity)

it will be great if you can figure this out, also - it is for my client

sgoley commented 5 years ago

@dr0rRvali

Sure - please contact me directly via email and we'll discuss the options from there.

dr0rRvali commented 5 years ago

@sgoley sent you a LinkedIn request.

sgoley commented 5 years ago

Four common folding errors:

"Data Type of column order_status with searchable property UNSEARCHABLE should be SEARCHABLE or ALL_EXCEPT_LIKE." = Text column not being recognized as searchable (One of my proprietary text columns which didn't get correctly cast to WLONGVARCHAR) (ex. sort functions)

"This ODBC driver doesn't support SQL_FN_TD_TIMESTAMPDIFF. You can override this by using SqlGetInfo for SQL_TIMEDATE_FUNCTIONS." = Date column that is being cast to Timestamp for an odd reason and so Date math cannot be applied. (ex. date filters)

"This ODBC Driver does not support SQL_GB_NO_RELATION. You can override this by using SqlCapabilities" = Driver does not support the highest level of Group By Requirements, has to be set in custom driver as another one of these values: SQL_GB_NOT_SUPPORTED = 0, SQL_GB_GROUP_BY_EQUALS_SELECT = 1, SQL_GB_GROUP_BY_CONTAINS_SELECT = 2, SQL_GB_NO_RELATION = 3, SQL_GB_COLLATE = 4 (ex. group numeric by name)

"This ODBC driver doesn't support SQL_AF_SUM. You can override this by using SqlGetInfo for SQL_AGGREGATE_FUNCTIONS" = Flag not set to allow standard aggregate functions / not picked up in Sql92Conformity parameter. (ex. any numeric "default summarizations")

Currently 1 & 2 are outstanding.

1 & 2 have been resolved - now working on the date / time intervals operators (ex. SQL_TSI_DAY) for the datetimeadd and datetimediff functions.

sgoley commented 5 years ago

Closing to continue working on Datetime / Date interval function under separate issue:

8

newuser-dotcom commented 2 years ago

Connecting PowerBI through Snowflake , and getting below error.

Using Direct Query

Screenshot 2022-02-07 162256

Mauricioortubeyz commented 2 years ago

Connecting PowerBI through Snowflake , and getting below error.

Using Direct Query

Screenshot 2022-02-07 162256

Set [enablefolding]= False