0 Kudos

cannot folder expression - data connector and PostgreSQL

Status: Accepted
by xsgao_pbi Visitor on ‎08-27-2018 12:38 PM

I want connect to Postgres ODBC data source with direct query enabled. So I took this sample project, https://github.com/Microsoft/DataConnectors/tree/master/samples/ODBC/SqlODBC, point Config_DriverName variable to "PostgreSQL Unicode(x64)" (name of my psqlODBC driver, version 03.51), and set ConnectionString based on a working ODBC DSN.

 

I am using Power BI Desktop, Version 2.61.5192.601 64-bit (August 2018), and there is no problem to add one table to my Power BI report.

 

But whenever I put a column into a table (or any other viz), I got this error:

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

And it happened to any column, varchar, number or date.

 

My original post on github: https://github.com/Microsoft/DataConnectors/issues/143

Status: Accepted
Comments
by Moderator v-qiuyu-msft
on ‎08-28-2018 02:20 AM

Hi @xsgao_pbi,

 

Which modification you made in SqlODBC sample project? Would you please share the whole project files with us? 

 

Best Regards,
Qiuyun Yu 

by Moderator v-qiuyu-msft
on ‎08-28-2018 02:20 AM
Status changed to: Needs Info
 
by xsgao_pbi Visitor
on ‎08-28-2018 12:35 PM
by Moderator v-qiuyu-msft
on ‎08-30-2018 03:12 AM

Hi @xsgao_pbi,

 

Thanks for your project. I gave reported this issue internally: CRI 82027633. Will update here once I get any information. 

 

Best Regards,
Qiuyun Yu 

by Moderator v-qiuyu-msft
on ‎08-30-2018 03:14 AM
Status changed to: Accepted
 
by Moderator v-qiuyu-msft
on ‎10-05-2018 01:38 AM

Hi @xsgao_pbi,

 

I got information below: 

 

Folding and DQ of custom connectors is not something that we support. If the customer wants to participate in the folding stack, they have to implement Table.View, instead of wrapping PostgreSQL connector. 

 

Best Regards,
Qiuyun Yu 

by xsgao_pbi Visitor
on ‎01-02-2019 11:19 AM

We got this fix by adding SQLGetTypeInfo and SQLColumns functions. PostgreSQL ODBC driver returns some duplicate types with same type names, and making them unique fixed the problem - no "cannot fold expression" errors now.

by sowrk Visitor
on ‎01-29-2019 02:43 AM

Hi @xsgao_pbi,

 

I am running into the same problem that you encountered. I created a custom connector to connect to postgres ODBC datasource with direct query enabled.

I get the 'Cannot fold expression to the datasource" error. But once I add the SQLGetTypeInfo and SQLColumns functions, not even able to load data from a table in PBI desktop due to an error - "Expression error - Token literal expected"

Could you please elaborate on your solution. Should the SQLGetTypeInfo function be modified to return only unique types? And any changes required in SQLColumns function?

 

 

Idea Statuses