DWQA QuestionsCategory: DatabaseCannot pass streamtable into createpartitionedtable to create distributed tables in dolphin DB?
JasonT asked 3 months ago

The table creation statement is as follows:

login("admin", "123456")
dbPath="dfs://thermalDB"
stream = streamTable(10000:0,`id`ts`tem,[SYMBOL,TIMESTAMP,DOUBLE])
dbDate = database(, VALUE, 2021.03.17..2031.03.17)
dbID = database(,  HASH,  [SYMBOL,  50])
db=database(dbPath, COMPO,  [dbDate,  dbID])
db.createPartitionedTable(stream, "pt", `ts`id)

report errors:

A stream table does not support direct access. Please use sql query to retrieve data

What’s the problem?,Incoming toCreatepartitionedtable functionThe table in cannot be a stream table. The table creation statement above can be written as follows:

login("admin", "123456")
dbPath="dfs://thermalDB"


dbDate = database(, VALUE, 2021.03.17..2031.03.17)
dbID = database(,  HASH,  [SYMBOL,  50])
db=database(dbPath, COMPO,  [dbDate,  dbID])
t = table(1:0,`id`ts`tem,[SYMBOL,TIMESTAMP,DOUBLE])
db.createPartitionedTable(t, "pt", `ts`id)
1 Answers
JasonTang answered 3 months ago

Incoming toCreatepartitionedtable functionThe table in cannot be a stream table. The table creation statement above can be written as follows:

login("admin", "123456")
dbPath="dfs://thermalDB"


dbDate = database(, VALUE, 2021.03.17..2031.03.17)
dbID = database(,  HASH,  [SYMBOL,  50])
db=database(dbPath, COMPO,  [dbDate,  dbID])
t = table(1:0,`id`ts`tem,[SYMBOL,TIMESTAMP,DOUBLE])
db.createPartitionedTable(t, "pt", `ts`id)