Glue ETL 强制数据类型为 long

Glue ETL force data type as long

我有以下输入:

 {
  "customTimeMs": 40
}

Glue 将其读取为:

 |-- customTimeMs: int

但我希望字体很长。

如果我使用这样的映射:

Seq(("customTimeMs" , "long" , "customTimeMs" , "long"))

它不会转换为 long,我不想将类型作为整数提及。

映射应匹配输入字段名称和类型:

val transformedDyf = renamedCrsRecommendations.applyMapping(
  mappings = Seq(
    (("customTimeMs" , "int" , "customTimeMs" , "long"))
  ),
  caseSensitive = false
)

然后将动态帧 transformedDyf 写入接收器。

我将映射更改为: Seq(("customTimeMs" , "customTimeMs" , "long")) 现在工作正常。