Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Teradata import Error - No More Spool Space

Hello,  I've written a SQL query to run against our Teradata DB, but when I run it in PowerBI, I get the following error:   When I run my query in the Teradata application, I get n...
  • Icey's avatar
    Icey
    4 years ago

    Hi Anonymous ,

     

    This may help you:

     

     It turns out this is just another example of what I blogged about here: Power BI wants to know the schema of the table before the query actually runs, so it asks Power Query to return the top 0 rows. Unfortunately, in this case query folding can’t take place and the top 0 filter can’t be pushed back to the database, so the entire query gets run once to get the schema and once to get the data.

     

    The solution is the same as the blog post I just mentioned too: use the Table.View M function to hard-code the schema returned by the query and implement query folding manually. Here’s the adapted version of the new query:

     

    Reference: Chris Webb's BI Blog: Why Is Power BI Running My SQL Query Twice? Chris Webb's BI Blog (crossjoin.co.uk)

     

     

    Best Regards,

    Icey

     

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