使用 Azure Data Factory 或 Synapse Analytics 複製 Vertica 的資料

適用於:Azure Data Factory Azure Synapse Analytics

提示

試用 Microsoft Fabric 中的 Data Factory,這是適用於企業的全方位分析解決方案。 Microsoft Fabric 涵蓋從資料移動到資料科學、即時分析、商業智慧和報告的所有項目。 了解如何免費開始新的試用

此文章概述如何使用 Azure Data Factory 或 Synapse Analytics 管線中的複製活動,從 Vertica 複製資料。 本文是根據複製活動概觀一文,該文提供複製活動的一般概觀。

支援的功能

此 Vertica 連接器支援下列功能:

支援的功能 IR
複製活動 (來源/-) ① ②
查閱活動 ① ②

① Azure 整合執行階段 ② 自我裝載整合執行階段

如需複製活動所支援作為來源/接收器的資料存放區清單,請參閱支援的資料存放區表格。

此服務提供的內建驅動程式可啟用連線,因此,您不需手動安裝任何驅動程式,即可使用此連接器。

必要條件

如果您的資料存放區位於內部部署網路、Azure 虛擬網路或 Amazon 虛擬私人雲端中,則必須設定自我裝載整合執行階段以與其連線。

如果您的資料存放區是受控雲端資料服務,則可使用 Azure Integration Runtime。 如果只能存取防火牆規則中核准的 IP,您可以將 Azure Integration Runtime IP 新增至允許清單。

您也可以使用 Azure Data Factory 中的受控虛擬網路整合執行階段功能來存取內部部署網路,而不需要安裝和設定自我裝載整合執行階段。

如需 Data Factory 支援的網路安全性機制和選項的詳細資訊,請參閱資料存取策略

開始使用

您可以使用 .NET SDK、Python SDK、Azure PowerShell、REST API 或 Azure Resource Manager 範本來建立具有複製活動的管線。 如需建立內含複製活動之管線的逐步指示,請參閱複製活動教學課程

使用 UI 建立連至 Vertica 的連結服務

使用下列步驟,在 Azure 入口網站 UI 中建立連至 Vertica 的連結服務。

  1. 前往 Azure Data Factory 或 Synapse 工作區的 [管理] 索引標籤,選取 [連結服務],然後按一下 [新增]:

  2. 搜尋 Vertica 並選取 Vertica 連接器。

    Screenshot of the Vertica connector.

  3. 設定服務詳細資料,測試連線,然後建立新的連結服務。

    Screenshot of linked service configuration for Vertica.

連接器設定詳細資料

下列各節提供屬性的相關詳細資料,這些屬性是用來定義 Vertica 連接器專屬的 Data Factory 實體。

連結服務屬性

以下是針對 Vertica 連結服務所支援的屬性:

屬性 描述 必要
type 類型屬性必須設為:Vertica Yes
connectionString 連線到 Vertica 的 ODBC 連接字串。
您也可以將密碼放在 Azure Key Vault 中,並從連接字串中提取 pwd 組態。 請參閱下列範例和在 Azure Key Vault 中儲存認證一文中的更多詳細資料。
Yes
connectVia 用於連線到資料存放區的 Integration Runtime。 深入了解必要條件一節。 如果未指定,就會使用預設的 Azure Integration Runtime。 No

範例:

{
    "name": "VerticaLinkedService",
    "properties": {
        "type": "Vertica",
        "typeProperties": {
            "connectionString": "Server=<server>;Port=<port>;Database=<database>;UID=<user name>;PWD=<password>"
        },
        "connectVia": {
            "referenceName": "<name of Integration Runtime>",
            "type": "IntegrationRuntimeReference"
        }
    }
}

範例:在 Azure Key Vault 中儲存密碼

{
    "name": "VerticaLinkedService",
    "properties": {
        "type": "Vertica",
        "typeProperties": {
            "connectionString": "Server=<server>;Port=<port>;Database=<database>;UID=<user name>;",
            "pwd": { 
                "type": "AzureKeyVaultSecret", 
                "store": { 
                    "referenceName": "<Azure Key Vault linked service name>", 
                    "type": "LinkedServiceReference" 
                }, 
                "secretName": "<secretName>" 
            }
        },
        "connectVia": {
            "referenceName": "<name of Integration Runtime>",
            "type": "IntegrationRuntimeReference"
        }
    }
}

資料集屬性

如需可用來定義資料集的區段和屬性完整清單,請參閱資料集一文。 本節提供 Vertica 資料集所支援的屬性清單。

若要從 Vertica 複製資料,請將資料集的類型屬性設定為 VerticaTable。 以下是支援的屬性:

屬性 描述 必要
type 資料集的類型屬性必須設定為:VerticaTable Yes
schema 結構描述的名稱。 否 (如果已指定活動來源中的「查詢」)
table 資料表的名稱。 否 (如果已指定活動來源中的「查詢」)
tableName 具有結構描述的資料表名稱。 支援此屬性是基於回溯相容性。 對於新的工作負載,請使用 schematable 否 (如果已指定活動來源中的「查詢」)

範例

{
    "name": "VerticaDataset",
    "properties": {
        "type": "VerticaTable",
        "typeProperties": {},
        "schema": [],
        "linkedServiceName": {
            "referenceName": "<Vertica linked service name>",
            "type": "LinkedServiceReference"
        }
    }
}

複製活動屬性

如需可用來定義活動的區段和屬性完整清單,請參閱管線一文。 本節提供 Vertica 來源所支援的屬性清單。

Vertica 作為來源

若要從 Vertica 複製資料,請將複製活動中的來源類型設定為 VerticaSource。 複製活動的 source 區段支援下列屬性:

屬性 描述 必要
type 複製活動來源的類型屬性必須設定為:VerticaSource Yes
query 使用自訂 SQL 查詢來讀取資料。 例如: "SELECT * FROM MyTable" 否 (如果已指定資料集中的 "tableName")

範例:

"activities":[
    {
        "name": "CopyFromVertica",
        "type": "Copy",
        "inputs": [
            {
                "referenceName": "<Vertica input dataset name>",
                "type": "DatasetReference"
            }
        ],
        "outputs": [
            {
                "referenceName": "<output dataset name>",
                "type": "DatasetReference"
            }
        ],
        "typeProperties": {
            "source": {
                "type": "VerticaSource",
                "query": "SELECT * FROM MyTable"
            },
            "sink": {
                "type": "<sink type>"
            }
        }
    }
]

查閱活動屬性

若要了解屬性的詳細資料,請參閱查閱活動

如需複製活動支援作為來源和接收器的資料存放區清單,請參閱支援的資料存放區