Sql 使用Azure数据工厂从Azure表存储提取数据时出错

Sql 使用Azure数据工厂从Azure表存储提取数据时出错,sql,data-warehouse,azure-sql-database,azure-data-factory,Sql,Data Warehouse,Azure Sql Database,Azure Data Factory,我想使用Azure数据工厂将数据从Azure表存储复制到Azure SQL Server,但出现了一个奇怪的错误 在我的Azure表存储中,我有一列包含多种数据类型(表存储就是这样工作的),例如日期时间和字符串 在我的数据工厂项目中,我提到整个列都是字符串,但出于某种原因,数据工厂基于提取过程中遇到的第一个单元格假定数据类型 在my Azure SQL Server数据库中,所有列都是字符串 范例 我在Azure表存储中有这个表:Flights RowKey PartitionKey A

我想使用Azure数据工厂将数据从Azure表存储复制到Azure SQL Server,但出现了一个奇怪的错误

在我的Azure表存储中,我有一列包含多种数据类型(表存储就是这样工作的),例如日期时间和字符串

在我的数据工厂项目中,我提到整个列都是字符串,但出于某种原因,数据工厂基于提取过程中遇到的第一个单元格假定数据类型

在my Azure SQL Server数据库中,所有列都是字符串

范例

我在Azure表存储中有这个表:Flights

RowKey   PartitionKey   ArrivalTime
--------------------------------------------------
1332-2   2213dcsa-213   04/11/2017 04:53:21.707 PM   - this cell is DateTime

1332-2   2213dcsa-214   DateTime.Null                - this cell is String
如果我的表与下面的表类似,那么复制过程将起作用,因为第一行是string,它将把整个列转换为string

RowKey   PartitionKey   ArrivalTime
--------------------------------------------------
1332-2   2213dcsa-214   DateTime.Null                - this cell is String

1332-2   2213dcsa-213   04/11/2017 04:53:21.707 PM   - this cell is DateTime
注意:我不允许更改Azure表存储中的数据类型、移动行或添加新行

以下是Azure data Factory的输入和输出数据集:

       "datasets": [
        {
            "name": "InputDataset",
            "properties": {
                "structure": [
                    {
                        "name": "PartitionKey",
                        "type": "String"
                    },
                    {
                        "name": "RowKey",
                        "type": "String"
                    },
                    {
                        "name": "ArrivalTime",
                        "type": "String"
                    }
                ],
                "published": false,
                "type": "AzureTable",
                "linkedServiceName": "Source-AzureTable",
                "typeProperties": {
                    "tableName": "flights"
                },
                "availability": {
                    "frequency": "Day",
                    "interval": 1
                },
                "external": true,
                "policy": {}
            }
        },
        {
            "name": "OutputDataset",
            "properties": {
                "structure": [
                    {
                        "name": "PartitionKey",
                        "type": "String"
                    },
                    {
                        "name": "RowKey",
                        "type": "String"
                    },
                    {
                        "name": "ArrivalTime",
                        "type": "String"
                    }
                ],
                "published": false,
                "type": "AzureSqlTable",
                "linkedServiceName": "Destination-SQLAzure",
                "typeProperties": {
                    "tableName": "[dbo].[flights]"
                },
                "availability": {
                    "frequency": "Day",
                    "interval": 1
                },
                "external": false,
                "policy": {}
            }
        }
    ]

有人知道这个问题的解决方案吗?

我只是在玩弄这个。我认为你有两个选择来处理这个问题

选项1

只需从输入数据集中删除数据类型属性。在输入JSON表数据集的“structure”块中,不必指定type属性。删除或注释掉它

例如:

{
"name": "InputDataset-ghm",
"properties": {
    "structure": [
        {
            "name": "PartitionKey",
            "type": "String"
        },
        {
            "name": "RowKey",
            "type": "String"
        },
        {
            "name": "ArrivalTime"
            /* "type": "String"  --<<<<<<  Optional! */
        },
{
“名称”:“InputDataset ghm”,
“财产”:{
“结构”:[
{
“名称”:“PartitionKey”,
“类型”:“字符串”
},
{
“名称”:“行键”,
“类型”:“字符串”
},
{
“名称”:“到达时间”

/*“type”:“String”-我只是在玩这个。我想你有两个选择来处理这个问题

选项1

只需从输入数据集中删除数据类型属性。在输入JSON表数据集中的“structure”块中,您不必指定类型属性。删除或注释它

例如:

{
"name": "InputDataset-ghm",
"properties": {
    "structure": [
        {
            "name": "PartitionKey",
            "type": "String"
        },
        {
            "name": "RowKey",
            "type": "String"
        },
        {
            "name": "ArrivalTime"
            /* "type": "String"  --<<<<<<  Optional! */
        },
{
“名称”:“InputDataset ghm”,
“财产”:{
“结构”:[
{
“名称”:“PartitionKey”,
“类型”:“字符串”
},
{
“名称”:“行键”,
“类型”:“字符串”
},
{
“名称”:“到达时间”

/*“类型”:“字符串”--您可以为表输入数据集提供JSON吗?ThanksHi Paul,我已经添加了数据工厂的输入和输出数据集。您可以为表输入数据集提供JSON吗?ThanksHi Paul,我已经添加了数据工厂的输入和输出数据集。感谢您的快速回复。第一个选项不起作用,仍然是throws出现错误。奇怪,它不适合我并通过了验证。嗯。感谢您的快速回复。第一个选项不起作用,仍然会抛出错误。奇怪,它不适合我并通过了验证。嗯。