A data engineer needs to create a table in Databricks using data from their organization's existing SQLite database. They run the following command:
CREATE TABLE jdbc_customer360
USING
OPTIONS (
url "jdbc:sqlite:/customers.db", dbtable "customer360"
)
Which line of code fills in the above blank to successfully complete the task?
To create a table in Databricks using data from an SQLite database, the correct syntax involves specifying the format of the data source. The format in the case of using JDBC (Java Database Connectivity) with SQLite is specified by the org.apache.spark.sql.jdbc format. This format allows Spark to interface with various relational databases through JDBC. Here is how the command should be structured:
CREATE TABLE jdbc_customer360
USING org.apache.spark.sql.jdbc
OPTIONS (
url 'jdbc:sqlite:/customers.db',
dbtable 'customer360'
)
The USING org.apache.spark.sql.jdbc line specifies that the JDBC data source is being used, enabling Spark to interact with the SQLite database via JDBC.
Reference: Databricks documentation on JDBC: Connecting to SQL Databases using JDBC
Delila
11 days agoDana
13 days agoVernice
21 days agoCharisse
22 days agoKristofer
3 days agoLashandra
7 days agoVilma
28 days ago