0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Azure Data Factory の メタデータ駆動のコピータスクにて Ingest Timestamp の Hive スタイルのパーティションの値を設定する方法

Last updated at Posted at 2024-06-05

概要

Azure Data Factory の メタデータ駆動のコピータスクにて Ingest Timestamp の Hive スタイルのパーティションの値(例:ngest_timestamp=2024-06-05 02%3A46%3A50)を設定する方法を共有します。MetadataDrivenCopyTask_xxx_BottomLevelパイプラインにおけるFullLoadOneObjectアクティビティと'DeltaLoadOneObject'アクティビティにて、cw_folderPathパラメータの設定値を下記のように修正することで対応できます。

@Concat(
    json(item().SinkObjectSettings).folderPath
    ,'/'
    ,'ingest_timestamp'
    ,'='
    ,formatDateTime(
        utcnow()
        ,'yyyy-MM-dd HH'
    ),
    '%3A'
    ,formatDateTime(
        utcnow()
        ,'mm'
    ),
    '%3A'
    ,formatDateTime(
        utcnow()
        ,'ss'
    )
)

image.png

パイプライン実行後にtest01/ingest_timestamp=2024-06-05 02%3A46%3A50のようなディレクトリにファイルが書き込まれます。

image.png

手順

1. Azure Data Factory にてメタデータ駆動のコピーアクティビティのパイプラインを構築

image.png

2. MetadataDrivenCopyTask_xxx_BottomLevelパイプラインを表示後にFullLoadOneObjectアクティビティと'DeltaLoadOneObject'アクティビティにのcw_folderPathパラメータを修正

@Concat(
    json(item().SinkObjectSettings).folderPath
    ,'/'
    ,'ingest_timestamp'
    ,'='
    ,formatDateTime(
        utcnow()
        ,'yyyy-MM-dd HH'
    ),
    '%3A'
    ,formatDateTime(
        utcnow()
        ,'mm'
    ),
    '%3A'
    ,formatDateTime(
        utcnow()
        ,'ss'
    )
)

image.png

3. パイプラインを実行

image.png

4. Azure Storage にて Hive スタイルのパーティションのディレクトリ構成となっていることを確認

image.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?