snappydata
snappydata copied to clipboard
how to insert data into table with spark sql cache
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 ?
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 thank you,i Debugged successful