Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Redshift ODBC Query Folding Failure due to Data Types

Hi there,

 

At first, I didn't know what the question was. I was a bit stuck. But I believe that my question is the following:

When applying filters, what data types will (and will not) result in query folding through the Redshift ODBC Driver?

 

I have checked Simba docs, I cannot find an answer there...

 

Please help!

 

Read on below to follow my train of exploration to this Q.

 

I am using the built-in Redshift ODBC connector and am expecting my query to fold. I am loading in a table and applying a filter on a column called "city". However, the query is not folding when I use filters.

 

Here are the driver details

 

NameValue
Driver NameMicrosoft Amazon Redshift ODBC Driver
Driver Version1.4.41.1000
DBMS NameRedshift
DBMS Version8.0.2

 

I recieve the following OdbcQuery: Folding Warning messages:

 

VisitInvocation
VisitTextFrom
VisitColumnAccess
Data Type of column [col_name] with searchable property UNSEARCHABLE should be SEARCHABLE or ALL_EXCEPT_LIKE. You can override the supported data types from ODBC driver using SQLGetTypeInfo.

 

After these, I recieve a OdbcQueryDomain: ReportFoldingFailure, as such:

 

Exception:

ExceptionType: Microsoft.Mashup.Engine1.Runtime.FoldingFailureException, Microsoft.MashupEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

Message: Exception of type 'Microsoft.Mashup.Engine1.Runtime.FoldingFailureException' was thrown.

StackTrace:

   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.VisitColumnAccess(ColumnAccessQueryExpression expression)

   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.VisitTextFrom(InvocationQueryExpression expression)

   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQueryExpressionVisitor.VisitInvocation(InvocationQueryExpression expression)

   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQuery.AddColumns(IList`1 selectItems, IList`1 queryExpressions, Keys keys, IValueReference[] typeValues, List`1 newColumns, OdbcQuerySpecification newQuerySpecification, Boolean allowAggregates, Int32[] groupKey, IList`1 tableKeys, Boolean ignoreRange)

   at Microsoft.Mashup.Engine1.Library.Odbc.OdbcQuer...

 

When searching for these errors, all support relates to custom-ODBC drivers. However, this Redshift driver is provided by Microsoft. I cannot find any other information around this. 

From what I can find, I think, but am not too sure, that the column type in Redshift is causing this issue. That's because the SQLGetInfo step cannot get any information, it's unsearchable. The column type that I am trying to filter in the datbase is "string"


To test this hypothesis, I attempted to apply a filter on an "int" column data type to see whether the query folders correctly, the query folds correctly.

So my final question is - what data types will be folded correctly? Do we have a list?

Thanks

Adam

2 REPLIES 2
edhans
Super User
Super User

They should all fold correctly. I've not used RedShift but I've filtered on decimals, integers, dates, and strings in Power Query to SQL and SnowFlake with no issues.

And even when folding breaks, it just continues to work in the Power Query mashup engine either on your desktop or gateway, it doesn't throw an error.

I'd consider opening a support ticket with MS. I have seen similar issues with Oracle not working correctly and there are double-bit character sets involved.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
Anonymous
Not applicable

Thanks for the reply Ed!

Yeah, the PQ mash up evaluator contines but it's on millions of rows so it is incredibly slow. I'd rather it be folded.

 

Since my post I have tried to join on definite integers and it displays a 
The function (..) -> is not valid
The left query is not a valid ODBC query

Second one is strange, because it folds correctly up to that point...

Also, neither Table.Join or Table.nestedJoin functions fold on a smaller dataset I have put into Redshift., tried inner and leftOuter jouns. Both queries are folded up to the join for left and right queries before passing the results over to the mash up evaluator.

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors