parameter.json(key,value格式)文件:
我们用它来获得参数或变量值。文件内容为:
"all_table":{
"table_name": [
"cast('011' as string) as col1",
"cast('EUR' as string) as col2",
"cast(old_clmn as double) as col3"
]
}
现在,我有了一个dataframe,需要在dateframe中添加上面的默认列(col1和col2)。我怎样才能实现它,我应该使用selectexpr方法吗??
在我有其他列要添加之后,可以使用withcolumn方法来完成。
我的另一个问题是如何将最终Dataframe的模式测试为所需的模式。让我们支持dataframe is的架构 [ "col1 string, col2 string, col string"]
在my parameter.json文件中传递的值的数据类型 [ "col1 string, col2 string, col3 double"]
???
有人能帮我吗??谢谢您
暂无答案!
目前还没有任何答案,快来回答吧!