![]() |
VOOZH | about |
Apache Spark is a fast and general engine for large-scale data processing. When paired with the CData JDBC Driver for Reckon Accounts Hosted, Spark can work with live Reckon Accounts Hosted data. This article describes how to connect to and query Reckon Accounts Hosted data from a Spark shell.
The CData JDBC Driver offers unmatched performance for interacting with live Reckon Accounts Hosted data due to optimized data processing built into the driver. When you issue complex SQL queries to Reckon Accounts Hosted, the driver pushes supported SQL operations, like filters and aggregations, directly to Reckon Accounts Hosted 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 Reckon Accounts Hosted data using native data types.
Download the CData JDBC Driver for Reckon Accounts Hosted installer, unzip the package, and run the JAR file to install the driver.
$ spark-shell --jars /CData/CData JDBC Driver for Reckon Accounts Hosted/lib/cdata.jdbc.reckonaccountshosted.jar
The connector makes requests to Reckon Accounts Hosted through OAuth. Specify the following connection properties:
CData provides an embedded OAuth application that simplifies OAuth desktop authentication. See the Help documentation for information on other OAuth authentication methods (web, headless, etc.), creating custom OAuth applications, and reasons for doing so.
For assistance in constructing the JDBC URL, use the connection string designer built into the Reckon Accounts Hosted JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.reckonaccountshosted.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 Reckon Accounts Hosted, using the connection string generated above.
scala> val reckonaccountshosted_df = spark.sqlContext.read.format("jdbc").option("url", "jdbc:reckonaccountshosted:SubscriptionKey=my_subscription_key;CountryVersion=2021.R2.AU;CompanyFile=Q:/CompanyName.QBW;User=my_user;Password=my_password;CallbackURL=http://localhost:33333;OAuthClientId=my_oauth_client_id;OAuthClientSecret=my_oauth_client_secret;InitiateOAuth=GETANDREFRESH;").option("dbtable","Accounts").option("driver","cdata.jdbc.reckonaccountshosted.ReckonAccountsHostedDriver").load()
Register the Reckon Accounts Hosted data as a temporary table:
scala> reckonaccountshosted_df.registerTable("accounts")
Perform custom SQL queries against the Data using commands like the one below:
scala> reckonaccountshosted_df.sqlContext.sql("SELECT Name, Balance FROM Accounts WHERE IsActive = true").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 Reckon Accounts Hosted in Apache Spark, you are able to perform fast and complex analytics on Reckon Accounts Hosted 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 Reckon Accounts Hosted Driver to get started:
Download NowLearn more:
👁 Reckon Accounts Hosted IconRapidly create and deploy powerful Java applications that integrate with Reckon Accounts Hosted.