如果要在csv文件里加一列TradeDate怎么在extChunkDS实现

如下的例子里:如果要在csv文件里加一列TradeDate怎么实现


建议使用textChunkDS 函数来导入,这样大文件会被切分为数据源,不会单次事务占用过大内存

例子:

def writeData(files, dirPath, dbName, tbName){
login("admin""123456")
pt = loadTable(dbName, tbName)
for(file in files ){
filePath = dirPath+"/"+file
print(filePath)
schemaTB = table(pt.schema().colDefs.name as name, pt.schema().colDefs.typeString as type)
try{ds = textChunkDS(filePath,512,",",schemaTB)
mr(ds, append!{pt},,,false)
}
catch(ex){print(ex)}
}
}
请先 登录 后评论

1 个回答

陈枢之 - 工程师

你是不是想说,在dfs里面加一列?csv是原始数据

请先 登录 后评论
  • 1 关注
  • 0 收藏,926 浏览
  • 泉清水静 提出于 2022-08-02 13:16

相似问题