简体   繁体   中英

How to confirm if the record's value fit the partition scheme in dolphindb?

I create a partitioned table. For example:

n=1000000
month=take(2000.01M..2016.12M, n)
x=rand(1.0, n)
t=table(month, x)
db=database("dfs://valuedb", VALUE, 2000.01M..2016.12M)
pt = db.createPartitionedTable(t, `pt, `month)

So the record's column 'month' should between 2000.01M..2016.12M.11. But I find that I can also insert the record with the value of 'month' is type DATE(not MONTH) in dolphindb:

t1 = table(2010.01.15 as month , 10 as x)
pt.append!(t1)

So how can I confirm if the record's value fit the partition scheme?

When the data type of partition column in database partitioning scheme is different from the data type of corresponding column in table, DolphinDB will try best to perform a implicit conversion. In your example, DATE type will be converted to MONTH type.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM