簡體   English   中英

如何在 Jar class(在 Scala 中)中定義多個主要方法並從 Azure 數據工廠調用它?

[英]How to define multiple main methods in a Jar class (in Scala) and call it from Azure Data Factory?

I am looking to create Jar file class which contains multiple main class methods(in Scala) so Azure data factory activity can call jar activity. Azure 數據工廠需要主要的 class 名稱和參數。

問候拉賈尼什

在 Azure 數據工廠中,Jar 文件在 manifest 中只能包含一個 Main-Class 屬性,這意味着 jar 只能包含一個 mainClassName。

在此處輸入圖像描述

這是 Databricks Jar 活動的示例 JSON 定義:

{
    "name": "ADB-Jar-Activity",
    "properties": {
        "activities": [
            {
                "name": "Jar1",
                "type": "DatabricksSparkJar",
                "dependsOn": [],
                "policy": {
                    "timeout": "7.00:00:00",
                    "retry": 0,
                    "retryIntervalInSeconds": 30,
                    "secureOutput": false,
                    "secureInput": false
                },
                "userProperties": [],
                "typeProperties": {
                    "mainClassName": "org.apache.spark.examples.SparkPi",
                    "parameters": [
                        "10",
                        "20"
                    ],
                    "libraries": [
                        {
                            "jar": "dbfs:/docs/sparkpi.jar"
                        }
                    ]
                },
                "linkedServiceName": {
                    "referenceName": "ADB",
                    "type": "LinkedServiceReference"
                }
            }
        ],
        "annotations": []
    }
}

參考: 通過在 Azure Databricks 中運行 Jar 活動來轉換數據

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM