da0963fdbf | ||
---|---|---|
.github | ||
connector | ||
docs | ||
samples | ||
.gitignore | ||
.scalafix.conf | ||
.scalafmt.conf | ||
LICENSE | ||
README.md | ||
SECURITY.md | ||
kusto_spark.png | ||
pom.xml |
README.md
Azure Data Explorer Connector for Apache Spark
This library contains the source code for Azure Data Explorer Data Source and Data Sink Connector for Apache Spark.
Azure Data Explorer (A.K.A. Kusto) is a lightning-fast indexing and querying service.
Spark is a unified analytics engine for large-scale data processing.
Making Azure Data Explorer and Spark work together enables building fast and scalable applications, targeting a variety of Machine Learning, Extract-Transform-Load, Log Analytics and other data-driven scenarios.
This connector works with the following spark environments: Azure Databricks, Azure Synapse Data Explorer and Real time analytics in Fabric
Changelog
Breaking changes in versions 5.2.x - From these versions, the published packages are shaded and packaged as a self contained jar. This is to avoid issues with common OSS libraries, spark runtimes and/or application dependencies.
For major changes from previous releases, please refer to Releases. For known or new issues, please refer to the issues section.
Note: Use the 4.x series only if you are using JDK 11. Versions 3.x and 5.x will work with JDK8 and all versions up From versions 5.2.0 and up, the connector is packaged as an uber jar to avoid conflicts with other jars that are added as part of the spark job definitions.
Usage
Linking
Starting version 2.3.0, we introduce new artifact Ids: kusto-spark_3.x_2.12
targeting Spark 3.x and Scala 2.12
and kusto-spark_2.4_2.11
targeting Spark 2.4.x and scala 2.11. The latter is built from branch "2.4".
For Scala/Java applications using Maven project definitions,
link your application with the artifact below to use the Azure Data Explorer Connector for Spark.
Note: Versions prior to 2.5.1 can no longer ingest to an existing table.
groupId = com.microsoft.azure.kusto
artifactId = kusto-spark_3.0_2.12
version = 5.2.2
In Maven:
Look for the following coordinates:
com.microsoft.azure.kusto:kusto-spark_3.0_2.12:5.2.2
Or clone this repository and build it locally to add it to your local maven repository,. The jar can also be found under the released package
<dependency>
<groupId>com.microsoft.azure.kusto</groupId>
<artifactId>kusto-spark_3.0_2.12</artifactId>
<version>5.2.2</version>
</dependency>
In SBT:
libraryDependencies ++= Seq(
"com.microsoft.azure.kusto" %% "kusto-spark_3.0" % "5.2.2"
)
In Databricks:
Libraries -> Install New -> Maven -> copy the following coordinates:
com.microsoft.azure.kusto:kusto-spark_3.0_2.12:5.2.2
Building Samples Module
Samples are packaged as a separate module with the following artifact
<artifactId>connector-samples</artifactId>
To build the whole project comprised of the connector module and the samples module, use the following artifact:
<artifactId>azure-kusto-spark</artifactId>
Build Prerequisites
To use the connector, you need:
- Java 1.8 SDK installed
- Maven 3.x installed
- Spark - with the version aligned with the artifact ID (either 2.4 or 3.0)
Note: when working with Spark version 2.3 or lower, build the jar locally from branch "2.4" and simply change the spark version in the pom file.
Build Commands
// Builds jar and runs all tests
mvn clean package
// Builds jar, runs all tests, and installs jar to your local maven repository
mvn clean install
Pre-Compiled Libraries
To facilitate ramp-up from local jar on platforms such as Azure Databricks, pre-compiled libraries are published under GitHub Releases. These libraries include:
- Azure Data Explorer connector library
- Version 5.2.0 and up of the library publish uber jars to maven. This is because of conflicts between custom jars that are added as part of the job and the exclude/include process that has to be followed to avoid conflicts.
Dependencies
Spark Azure Data Explorer connector depends on Azure Data Explorer Data Client Library and Azure Data Explorer Ingest Client Library, available in maven repository. When Key Vault based authentication is used, there is an additional dependency on Microsoft Azure SDK For Key Vault.
Note: When working with JARs, Azure Data Explorer connector requires Azure Data Explorer Java client libraries (and azure key-vault library if used) to be installed. To find the right version to install, look in the relevant release's pom)
Documentation
Detailed documentation can be found here.
Samples
Usage examples can be found here
Available Azure Data Explorer client libraries:
Currently available client libraries for Azure Data Explorer:
For the comfort of the user, here is a Pyspark sample for the connector.
Need Support?
- Have a feature request for SDKs? Please post it on User Voice to help us prioritize
- Have a technical question? Ask on Stack Overflow with tag "azure-data-explorer"
- Need Support? Every customer with an active Azure subscription has access to support with guaranteed response time. Consider submitting a ticket for assistance from the Microsoft support team.
- Found a bug? Please help us fix it by thoroughly documenting it and filing an issue.
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.