Forum Discussion
Value.NativeQuery bypass Query Folding?
- Anonymous1 year ago
Value.NativeQuery is a query written in the source's native language, which is what query folding does with M code. There is no need for query folding on a NativeQuery, because it already is a Native Query.
--Nate
- Anonymous1 year agoNot applicable
There is written: This article showcases an alternative method to create native queries against your data source using the Value.NativeQuery function and keep the query folding mechanism active for subsequent steps of your query.
This seems to be the closest answer to my question. Although it mentions that users can write native queries, it doesn’t explicitly state that Query Folding does not occur for the transformation step with Query Folding. I’ve encountered situations before where I assumed one thing, but the reality was different. Therefore, I want to be certain I understand this correctly.
If I’m mistaken, could you please provide the exact text that explicitly confirms Query Folding does not occur during the transformation step when using the Value.NativeQuery function?
- lbendlin1 year agoSuper User
You are missing the bigger picture. Native Queries fold by definition, but they also prevent further folding in subsequent steps. UNLESS you indicate that they support it.
- Anonymous1 year agoNot applicable
Thank you for your time regarding this topi.
My understanding follows.
Query Folding means combining or "folding" multiple steps in a given query into a single operation (source: https://www.dremio.com/wiki/query-folding/). That's it, nothing else. In other words, when we say Query Folding or only folding, we mean taking Power Query transformation steps (or M Script / M Code) and creating a single query that is the native query for the data source. Note: There is nothing regarding sending to the data source when we talk about the pure Query Folding.
As discussed with Anonymous, why should Power Query Mashup Engine create a native query from an already prepared native query?
You wrote "Native Queries fold by definition" which means, take a native query and fold it, meaning create a new native query from that taken native query. That does not make a sense to me. I doubt that Power Query Mashup Engine would be so ineffective, but I wanted to be sure, therefore I created this topic.