snappydata icon indicating copy to clipboard operation
snappydata copied to clipboard

how to insert data into table with spark sql cache

Open xlows-1227 opened this issue 7 years ago • 2 comments

I cache some data with spark sql cache , like 'sqlContext.sql("CACHE TABLE activity_cached as select * from activity where ...")'

how can i insert this data to snappydata table ?

xlows-1227 avatar Nov 07 '17 12:11 xlows-1227

Hi @luoruixing Typically you would create a SnappySession object which would be used to create the table you want to store data in. Then you would write the data you want to cache to that table. As such, you wouldn't need to first cache the data using Spark's in-memory cache.

You might find these documents helpful:

How to create a column table and run queries: http://snappydatainc.github.io/snappydata/howto/create_column_tables_and_run_queries/

How to load data into SnappyData: http://snappydatainc.github.io/snappydata/howto/load_data_into_snappydata_tables/

piercelamb avatar Nov 07 '17 17:11 piercelamb

@piercelamb thank you,i Debugged successful

xlows-1227 avatar Nov 14 '17 06:11 xlows-1227