![]() |
VOOZH | about |
Apache Spark is a fast and general engine for large-scale data processing. When paired with the CData JDBC Driver for HCL Domino, Spark can work with live HCL Domino data. This article describes how to connect to and query HCL Domino data from a Spark shell.
The CData JDBC Driver offers unmatched performance for interacting with live HCL Domino data due to optimized data processing built into the driver. When you issue complex SQL queries to HCL Domino, the driver pushes supported SQL operations, like filters and aggregations, directly to HCL Domino and utilizes the embedded SQL engine to process unsupported operations (often SQL functions and JOIN operations) client-side. With built-in dynamic metadata querying, you can work with and analyze HCL Domino data using native data types.
Download the CData JDBC Driver for HCL Domino installer, unzip the package, and run the JAR file to install the driver.
$ spark-shell --jars /CData/CData JDBC Driver for HCL Domino/lib/cdata.jdbc.domino.jar
To connect to Domino data, set the following properties:
Domino supports authenticating via login credentials or an Entra ID (formerly Azure AD) OAuth application:
To authenticate with login credentials, set the following properties:
The driver uses the login credentials to automatically perform an OAuth token exchange.
This authentication method uses Entra ID (formerly Azure AD) as an IdP to obtain a JWT token. You need to create a custom OAuth application in Entra ID (formerly Azure AD) and configure it as an IdP. To do so, follow the instructions in the Help documentation. Then set the following properties:
The tenant ID is the same as the directory ID shown in the Azure Portal's Entra ID (formerly Azure AD) > Properties page.
For assistance in constructing the JDBC URL, use the connection string designer built into the HCL Domino JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.domino.jar
Fill in the connection properties and copy the connection string to the clipboard.
👁 Using the built-in connection string designer to generate a JDBC URL (Salesforce is shown.)Configure the connection to HCL Domino, using the connection string generated above.
scala> val domino_df = spark.sqlContext.read.format("jdbc").option("url", "jdbc:domino:Server=https://domino.corp.com;AuthScheme=OAuthPassword;User=my_domino_user;Password=my_domino_password;").option("dbtable","ByName").option("driver","cdata.jdbc.domino.DominoDriver").load()
Register the HCL Domino data as a temporary table:
scala> domino_df.registerTable("byname")
Perform custom SQL queries against the Data using commands like the one below:
scala> domino_df.sqlContext.sql("SELECT Name, Address FROM ByName WHERE City = Miami").collect.foreach(println)
You will see the results displayed in the console, similar to the following:
👁 Data in Apache Spark (Salesforce is shown)Using the CData JDBC Driver for HCL Domino in Apache Spark, you are able to perform fast and complex analytics on HCL Domino data, combining the power and utility of Spark with your data. Download a free, 30 day trial of any of the hundreds of CData JDBC Drivers and get started today.
Download a free trial of the HCL Domino Driver to get started:
Download NowLearn more:
👁 HCL Domino IconRapidly create and deploy powerful Java applications that integrate with HCL Domino.