cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
garrettmindrup
Frequent Visitor

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:


 

PBI_TAS_Spool_Error.jpg

When I run my query in the Teradata application, I get no issues and it pulls just fine. It's pulling ~7 million rows of data and 65 columns. I've pulled queries with at least 11 million rows before and had no issues (albeit probably fewer columns). 

Any ideas on what the issue is or how I could resolve it? 

 

UPDATE:

I was told on a seperate forum that PowerBI runs SQL queries twice when pulling data. If this is true, this would explain why I run out of spool space in PowerBI but not in Teradata Studio. Can anyone confirm this is how PowerBI runs queries? 



 

1 ACCEPTED SOLUTION

Hi @garrettmindrup ,

 

This may help you:

 

 It turns out this is just another example of what I blogged about herePower 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...

 

 

Best Regards,

Icey

 

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

3 REPLIES 3
amitchandak
Super User
Super User

@garrettmindrup , refer if the option , can help

MODIFY [PROFILE profile_name | USER user_name ] AS SPOOL = 100000000 bytes ;

 

https://stackoverflow.com/questions/12479691/no-more-spool-space-in-database



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || 50+Power Query List Functions : Learn Power Query List
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

Thanks, @amitchandak. I've tried this and I don't have rights to modify user spool in Teradata. My spool space is almost 812,000,000,000. 

Do you know if trying to run the query through PowerBI somehow limits my spool space? My query runs just fine in the Teradata application with no spool space errors, it only occurs when trying to pull from PowerBI. 

Hi @garrettmindrup ,

 

This may help you:

 

 It turns out this is just another example of what I blogged about herePower 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...

 

 

Best Regards,

Icey

 

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

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show Episode 10 Recap

The Power BI Community Show

Watch the playback when Amit Chandak, a Power BI Super User, demos how to use Field Parameters to make reports more dynamic.

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Health and Life Sciences Power BI User Group

Health and Life Sciences Power BI User Group

Power BI specialists at Microsoft have created a community user group where customers in the provider, payor, pharma, health solutions, and life science industries can collaborate.

Top Solution Authors