DWQA QuestionsCategory: DatabaseHow to add new columns to distributed tables that have been created and written data in dolphin DB?
JasonT asked 3 months ago

I created a distributed table in dolphin DB through the following code, and have written some data:

ID=1..6
x=1..6
t1=table(ID, x)
db=database("dfs://rangedb", RANGE, 1 4 7)
pt = db.createPartitionedTable(t1, `pt, `ID)
pt.append!(t1);

Now I want to add two columns to the distributed table that has written data, namely [“price”, “qty”] and [double, int]. What should I do?,Can passAddcolumn functionAdd, for example:

pt = loadTable("dfs://rangedb", "pt")
addColumn(pt,["price", "qty"],[DOUBLE, INT]);
1 Answers
JasonTang answered 3 months ago

Can passAddcolumn functionAdd, for example:

pt = loadTable("dfs://rangedb", "pt")
addColumn(pt,["price", "qty"],[DOUBLE, INT]);