Получить активность метаданных ADF V2

Может ли кто-нибудь объяснить мне, какова польза от Get Metadata Activity, недавно введенного в ADF V2?

На самом деле информации, представленной на docs.microsoft.com, недостаточно для понимания использования этого Activity.


person Aritra Sarkar    schedule 19.04.2018    source источник


Ответы (1)


Основная цель действия получения метаданных:

  • Проверяйте информацию метаданных любых данных
  • Запускать конвейер, когда данные готовы / доступны

В следующем примере показано, как постепенно загружать измененные файлы из папки с помощью действия «Получить метаданные», получая имена файлов и измененную метку времени:

            {
                "name": "IncrementalloadfromSingleFolder",
                "properties": {
                    "activities": [
                        {
                            "name": "GetFileList",
                            "type": "GetMetadata",
                            "policy": {
                                "timeout": "7.00:00:00",
                                "retry": 0,
                                "retryIntervalInSeconds": 30,
                                "secureOutput": false
                            },
                            "typeProperties": {
                                "dataset": {
                                    "referenceName": "SrcLocalDir",
                                    "type": "DatasetReference"
                                },
                                "fieldList": [
                                    "childItems"
                                ]
                            }
                        },
                        {
                            "name": "ForEachFile",
                            "type": "ForEach",
                            "dependsOn": [
                                {
                                    "activity": "GetFileList",
                                    "dependencyConditions": [
                                        "Succeeded"
                                    ]
                                }
                            ],
                            "typeProperties": {
                                "items": {
                                    "value": "@activity('GetFileList').output.childItems",
                                    "type": "Expression"
                                },
                                "activities": [
                                    {
                                        "name": "GetLastModifyfromFile",
                                        "type": "GetMetadata",
                                        "policy": {
                                            "timeout": "7.00:00:00",
                                            "retry": 0,
                                            "retryIntervalInSeconds": 30,
                                            "secureOutput": false
                                        },
                                        "typeProperties": {
                                            "dataset": {
                                                "referenceName": "SrcLocalFile",
                                                "type": "DatasetReference"
                                            },
                                            "fieldList": [
                                                "lastModified"
                                            ]
                                        }
                                    },
                                    {
                                        "name": "IfNewFile",
                                        "type": "IfCondition",
                                        "dependsOn": [
                                            {
                                                "activity": "GetLastModifyfromFile",
                                                "dependencyConditions": [
                                                    "Succeeded"
                                                ]
                                            }
                                        ],
                                        "typeProperties": {
                                            "expression": {
                                                "value": "@and(less(activity('GetLastModifyfromFile').output.lastModified, pipeline().parameters.current_time), greaterOrEquals(activity('GetLastModifyfromFile').output.lastModified, pipeline().parameters.last_time))",
                                                "type": "Expression"
                                            },
                                            "ifTrueActivities": [
                                                {
                                                    "name": "CopyNewFiles",
                                                    "type": "Copy",
                                                    "policy": {
                                                        "timeout": "7.00:00:00",
                                                        "retry": 0,
                                                        "retryIntervalInSeconds": 30,
                                                        "secureOutput": false
                                                    },
                                                    "typeProperties": {
                                                        "source": {
                                                            "type": "FileSystemSource",
                                                            "recursive": false
                                                        },
                                                        "sink": {
                                                            "type": "BlobSink"
                                                        },
                                                        "enableStaging": false,
                                                        "dataIntegrationUnits": 0
                                                    },
                                                    "inputs": [
                                                        {
                                                            "referenceName": "SrcLocalFile",
                                                            "type": "DatasetReference"
                                                        }
                                                    ],
                                                    "outputs": [
                                                        {
                                                            "referenceName": "TgtBooksBlob",
                                                            "type": "DatasetReference"
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ],
                    "parameters": {
                        "current_time": {
                            "type": "String",
                            "defaultValue": "2018-04-01T00:00:00Z"
                        },
                        "last_time": {
                            "type": "String",
                            "defaultValue": "2018-03-01T00:00:00Z"
                        }
                    },
                    "folder": {
                        "name": "IncrementalLoadSingleFolder"
                    }
                },
                "type": "Microsoft.DataFactory/factories/pipelines"
            }

См. Также недавно обновленный документация.

person Hauke Mallow    schedule 06.05.2018