如何在AWS Glue中使用resolveChoice()转换指定数组结构体?
AWS Glue中使用resolveChoice指定嵌套数组结构Schema的方法
当你需要在AWS Glue作业中通过resolveChoice()指定individual_lender_probs这个嵌套数组结构的Schema时,需要明确写出数组内部结构体的完整字段和类型定义,具体写法如下:
df = df.resolveChoice(specs = [('individual_lender_probs','cast:<strong>array<struct<lender:string,buy_rate:double,approve_prob:double>></strong>')])
array<>用于声明外层的数组类型- 数组元素为
struct<>类型,内部按顺序定义每个字段的名称与对应数据类型,字段之间用逗号分隔
内容的提问来源于stack exchange,提问作者user12253044
相关产品推荐
相关产品推荐

