QuestionQ233

VerifiedDevelopment and Ingestion

A data engineer has set up a Lakeflow Job that runs daily to ingest customer transaction data from a legacy relational database. The extracted data needs to be written directly into a Unity Catalog table and be immediately available for SQL queries. The team also needs to make sure that full data lineage is preserved.

Which approach achieves this ingestion with direct landing in Unity Catalog, preserved lineage, and immediate SQL queryability?

Explanation

Unity Catalog automatically tracks lineage for tables that are read and written using the Spark DataFrame API with fully qualified three-level names (catalog.schema.table). Reading the source data with spark.read.format("jdbc") and writing it using saveAsTable("catalog.schema.table") creates a native Unity Catalog managed table, making it immediately queryable via SQL while allowing Unity Catalog to capture the lineage relationship between the source JDBC read and the resulting table. Lineage capture requires that both source and target be registered in Unity Catalog and referenced through the Spark DataFrame or SQL interfaces rather than by file path; staging data externally, converting to Pandas and saving to an external path, or writing to /dbfs/ all bypass native Unity Catalog table registration and therefore do not preserve lineage or provide direct SQL queryability.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!