Insert Data

Use function append! or tableInsert to insert data into tables. Even if just one row of data is to be inserted, the new data must take the data form of table.

Note: If the database is VALUE partitioned and the partitioning column is of STRING type, then the appended partitioning column must not contain spaces, “n”, “r” or “t”.

In the following example, table t is inserted into the distributed table pt.

$ n=1000000
$ ID=rand(10, n)
$ x=rand(1.0, n)
$ t=table(ID, x)
$ db=database("dfs://rangedb", RANGE,  0 5 10)
$ pt=db.createPartitionedTable(t, `pt, `ID)
$ pt.append!(t);
//equal to pt.tableInsert(t)

$ select count(x) from pt;

count_x

1000000