
Answer-first summary for fast verification
Answer: org.apache.spark.sql.jdbc
## Explanation The correct answer is **A. org.apache.spark.sql.jdbc**. ### Why this is correct: 1. **JDBC Data Source**: When creating a table from an external database using JDBC (Java Database Connectivity) in Spark SQL/Databricks, you need to specify the JDBC data source format. 2. **Format Syntax**: The correct format is `org.apache.spark.sql.jdbc` for JDBC connections. 3. **SQLite JDBC URL**: The URL `jdbc:sqlite:/customers.db` indicates this is a JDBC connection to a SQLite database, so the JDBC data source must be used. ### Why other options are incorrect: - **B. autoloader**: Auto Loader is for streaming file ingestion, not for JDBC database connections. - **C. DELTA**: Delta format is for creating Delta Lake tables, not for connecting to external SQLite databases via JDBC. - **D. sqlite**: There is no built-in `sqlite` format in Spark SQL for creating tables. - **E. org.apache.spark.sql.sqlite**: This is not a valid Spark SQL data source format. ### Complete working command: ```sql CREATE TABLE jdbc_customer360 USING org.apache.spark.sql.jdbc OPTIONS ( url "jdbc:sqlite:/customers.db", dbtable "customer360" ) ``` This command creates an external table in Databricks that references the `customer360` table in the SQLite database file `customers.db`.
Author: Keng Suppaseth
Ultimate access to all questions.
No comments yet.
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"
)
CREATE TABLE jdbc_customer360
USING ______
OPTIONS (
url "jdbc:sqlite:/customers.db",
dbtable "customer360"
)
Which of the following lines of code fills in the above blank to successfully complete the task?
A
org.apache.spark.sql.jdbc
B
autoloader
C
DELTA
D
sqlite
E
org.apache.spark.sql.sqlite