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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Query folding in Snowflake DirectQuery is failing

I have a query with DirectQuery.  It has 4 steps:

1. Source (Connet to snowflake)

2. Navigation (navigate to the table and define warehouse)

3. Rename some columns

4. Remove some columns.

 

When I check on the queries executed on Snowflake, I see two queries.  I would expect that one query is executed with only the columns that are remaining.  Any ideas why there is no query folding happeining?

 

Thanks

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

Are you using a native database query when connecting to Snowflake, and if so, there are some limitation on query folding:

Query folding while using a native database query is limited to the PostgreSQL connector only. No other connectors support query folding if you use a native database query. Also, for folding to work in the PostgreSQL connector, the native database query you enter has to work as a subquery.


Also, in this case below, it is mentioned that query folding does not work if there are arrays involved in the data source query.

Does Snowflake support query folding when used as a data source by Power BI?

Power BI Incremental Refresh with Snowflake

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yiruan-msft
Community Support
Community Support

Hi @Anonymous ,

Are you using a native database query when connecting to Snowflake, and if so, there are some limitation on query folding:

Query folding while using a native database query is limited to the PostgreSQL connector only. No other connectors support query folding if you use a native database query. Also, for folding to work in the PostgreSQL connector, the native database query you enter has to work as a subquery.


Also, in this case below, it is mentioned that query folding does not work if there are arrays involved in the data source query.

Does Snowflake support query folding when used as a data source by Power BI?

Power BI Incremental Refresh with Snowflake

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

@Anonymous In Power Query Editor, right-click each step of the query and see when View Native Query gets greyed out. That is the step that is negating query folding.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler "View native query" is not supported with Snowflake.  Even if query folding is working, this feature is always greyed out.

@Anonymous Well then you answered your own question? View native query is present when query folding is occurring so if Snowflake doesn't support view native query then it doesn't support query folding...yes?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

No... 

 

if "View Native Query" is enabled, then query folding is working.

If "View Native Query" is disabled then you cannot draw any conclusions.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.