【发布时间】:2020-05-26 08:11:26
【问题描述】:
我们使用 AWS DMS 将 SQL Server 数据库作为 parquet 文件转储到 S3 中。想法是在镶木地板上运行一些带有火花的分析。完全加载完成后,将无法读取镶木地板,因为它们在架构中有 UINT 字段。 Spark 拒绝使用Parquet type not supported: INT32 (UINT_8) 阅读它们。我们使用转换规则来覆盖UINT 列的数据类型。但看起来它们没有被 DMS 引擎拾取。为什么?
有许多规则,如“将单位转换为 int”,见下文(注意 UINT1 是 1 字节无符号 DMS DataTypes):
{
"rule-type": "transformation",
"rule-id": "7",
"rule-name": "uintToInt",
"rule-action": "change-data-type",
"rule-target": "column",
"object-locator": {
"schema-name": "%",
"table-name": "%",
"column-name": "%",
"data-type": "uint1"
},
"data-type": {
"type": "int4"
}
}
S3 DataFormat=parquet;ParquetVersion=parquet_2_0 和 DMS 引擎版本是 3.3.2
但是仍然使用 uint 获取 parquet 模式。见下文:
id: int32
name: string
value: string
status: uint8
尝试使用 spark 阅读这样的镶木地板给了我
org.apache.spark.sql.AnalysisException: Parquet type not supported: INT32 (UINT_8);
at org.apache.spark.sql.execution.datasources.parquet.ParquetToSparkSchemaConverter.typeNotSupported$1(ParquetSchemaConverter.scala:100)
at org.apache.spark.sql.execution.datasources.parquet.ParquetToSparkSchemaConverter.convertPrimitiveField(ParquetSchemaConverter.scala:136)
为什么没有触发 DMS 转换规则?
【问题讨论】:
-
我遇到了限制吗?
Changes to the source table structure during full load are not supporteddocs.aws.amazon.com/dms/latest/userguide/CHAP_Target.S3.html -
您知道如何完成这项工作吗?谢谢。
-
@Anton 你还在面对这个问题吗?我使用了下面提出的解决方案并且它有效(我将更改应用于所有模式-%):{“rule-type”:“transformation”,“rule-id”:“2”,“rule-name”:“uint1 -to-int4", "rule-action": "change-data-type", "rule-target": "column", "object-locator": { "schema-name": "%", "table-名称”:“%”,“列名称”:“%”,“数据类型”:“uint1”},“数据类型”:{“类型”:“int1”}}
-
@dp6000,自从 DMS 3.3.2 以来我没有尝试过,我们放弃了 DMS 以支持其他解决方案
标签: apache-spark amazon-s3 aws-dms