无法从 Azure 存储到 Synapse 池SQL 数据仓库的 ADF polybase 文件

问题描述

如何让 ADF copy polybase 简单地将一个文件从 Azure 存储复制到 Synapse 池(sql 数据仓库)

我一直收到这个错误

Operation on target Storage to Synapse Failed: ErrorCode=FailedDbOperation,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Error happened when loading data into sql Data Warehouse.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Data.sqlClient.sqlException,Message=HdfsBridge::recordReaderFillBuffer - Unexpected error encountered filling record reader buffer: HadoopsqlException: Error converting data type NVARCHAR to BIGINT.,Source=.Net sqlClient Data Provider,sqlErrorNumber=107090,Class=16,ErrorCode=-2146232060,State=1,Errors=[{Class=16,Number=107090,},],'

摘要HadoopsqlException: Error converting data type NVARCHAR to BIGINT.,

这是我的文件示例,gzip 压缩:

6872602179|359154818|84154822|1|37.00|68629.82|0.08|0.06|A|F|1992-09-01|1992-08-18|1992-09-05|TAKE BACK RETURN|REG AIR|efully. quickly bold deposits wake alo
6872602179|315023025|90023035|2|22.00|20509.94|0.02|0.05|A|F|1992-10-01|1992-07-06|1992-10-08|DELIVER IN PERSON|FOB| furIoUs,pen
6872602179|591976355|41976366|3|41.00|57472.16|0.07|0.00|A|F|1992-07-23|1992-08-06|1992-08-18|TAKE BACK RETURN|AIR|have to are about the final instructions. 
6872602179|1346584608|46584609|4|37.00|60135.36|0.00|0.05|R|F|1992-09-06|1992-07-23|1992-10-01|TAKE BACK RETURN|FOB|ackages according to the r
6872602179|47498972|97498973|5|31.00|61026.60|0.02|0.03|R|F|1992-06-05|1992-07-21|1992-06-07|NONE|REG AIR|ests cajole slyly quickly special attai
6872602179|315209731|90209741|6|31.00|56574.38|0.06|0.05|R|F|1992-06-15|1992-07-27|1992-07-15|COLLECT COD|SHIP|y bold instructions. even p

ADF 中的源数据集设置:

enter image description here

ADF 复印设置:

来源:

enter image description here

水槽:

enter image description here

映射:

enter image description here

目标表架构:

CREATE  table dbo.[lineitem](
    [L_OrderKey] [bigint] NULL,[L_PartKey] [bigint] NULL,[L_SuppKey] [bigint] NULL,[L_LineNumber] [bigint] NULL,[L_Quantity] [bigint] NULL,[L_dboendedPrice] [decimal](13,2) NULL,[L_discount] [decimal](13,[L_Tax] [decimal](13,[L_ReturnFlag] [varchar](64) NULL,[L_Linestatus] [varchar](64) NULL,[L_ShipDate] [datetime] NULL,[L_CommitDate] [datetime] NULL,[L_ReceiptDate] [datetime] NULL,[L_ShipInstruct] [varchar](64) NULL,[L_ShipMode] [varchar](64) NULL,[L_Comment] [varchar](64) NULL    
) ;

解决方法

我建议通过在 polybase 表的开头仅保留 1 个 BigInt 列来调试此问题,如果成功则意味着第 1 列中没有存在此问题的数据,第二次调试运行时仅保留 2 个 BigInt 列然后检查。

通过这种方式,您将能够知道哪个实际列有问题,然后您可以检查您的文件是否存在任何数据问题。

让我知道这是否有帮助!

谢谢!