关于loadTextEx函数的疑问

在导入的时候我想将int类型的time列转化为nanotime类型,这个最后的transform参数应该怎么写?

schema=extractTextSchema(dataFilePath)
update schema set type="NANOTIME" where name="time"
tb=table(1:0, schema.name, schema.type)
tb=db.createPartitionedTable(tb,`tb1,`date)
tmpTB = loadTextEx(db,`tb1,`date,dataFilePath,,,,replaceColumn!{, `time, })
请先 登录 后评论

1 个回答

Jason Tang - 时序数据库技术支持

可以定义一个如下所示函数作为transform参数:

def foo(mutable t){
 return t.replaceColumn!(`time, nanotime(t.time))
}

也可参阅https://github.com/dolphindb/... 来实现。

请先 登录 后评论