How to import the data from a partitioned table to an in-memory table?

18 Views Asked by At

Suppose there is an empty in-memory table t whose columns are the same as a partitioned table, how to import the data from the partitioned table to t.

1

There are 1 best solutions below

0
winnie On

First, use the following SQL statement to query the specified data in the partitioned table. If the data volume is large, loop over the table partition by partition for query.

data=select * from loadTable(...) where partition(...)

Second, import the data into the in-memory table t using the tableInsert function, which can return the number of inserted rows. Then, set the variable data to NULL to release it.

tableInsert(t, data) data=NULL You can also use the mr function to import the data in parallel by partition, or use the replay function to directly replay the data to the in-memory table.