cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to cache on 500 billion rows

JoseMacedo
New Contributor II

Hello!

I'm using a server less SQL cluster on Data bricks and I have a dataset on Delta Table that has 500 billion rows. I'm trying to filter to have around 7 billion and the cache that dataset to use it on other queries and make it run faster.

When I cache the table it takes 1s and gives no error/warning.

When I select the cache table it gives and error that cannot be found. 

This is what I'm doing:

CACHE TABLE table_filtered_cache AS select * from prod_datalake.table a
WHERE
a.year >= 2023 etc


and then

select count(*) from table_filtered_cache

What am I doing wrong, and what would you advise me to do?

3 REPLIES 3

-werners-
Esteemed Contributor III

can you try with creating a global temp view of the cache?

I tried doing like:
CREATE GLOBAL TEMPORARY VIEW table_filtered_cache AS select
 
Got an error

"GLOBAL TEMPORARY VIEW is not supported on a SQL warehouse."

-werners-
Esteemed Contributor III

I missed the 'serverless sql' part.  CACHE is for spark, I don´t think it works for serverless sql.
Here is how caching works on DBSQL.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group