data pipelines with apache spark declarative pipelines

- 5 mins

this post introduces how databricks supports efficient data engineering by combining optimized storage techniques, unified data governance through unity catalog, lakeflow’s integrated capabilities for data ingestion, transformation, and orchestration

data engineering platform overview

data engineering for data intelligence platform:

bên dưới có data processing engine: spark + structured streaming

unified governance: unity catalog is centralized data catalog that provides access control, auditing, data lineage, quality monitoring, data discovery, across databricks workspaces

optimized storage: delta lake, parquet, iceberg

=> focus on apache spark declarative pipeline (simplifying batch and streaming etl )

reliable data pipelines are hard to build

spark declaratives pipelines: reliable data pipeline made easy

focus on what really matters: writing and managing transformation logic

follow the medallion architecture, progressing data through bronze, silver and gole layers

medallion architecture:

có 2 cách tạo spark declarative pipeline

dataset types trong databricks

các core concepts and components của spark declarative pipelines bao gồm streaming tables materialized views, temporary views function and differ

dataset types có 3 loại chính, cho các mục đích khác nhau:

streaming table

example syntax: CREATE OR REFRESH STREAMING TABLE statement to create a streaming table called orders_bronze in the 1_bronze_db schema.

The SELECT clause defines which columns you want to pull into the streaming table from your source data. In the FROM clause:

materialized views

process records as needed to deliver accurate results based on the current state of your streaming tables

example create a materialized view with sql:

CREATE OR REFRESH MATERIALIZED VIEW 3_gold_db.gold_orders_by_date AS
SELECT
  date(order_timestamp) AS order_date,
  count(*) AS total_daily_orders
FROM 2_silver_db.orders_silver
GROUP BY date(order_timestamp);

Temporary views and views

temporary view: exist only for the duration of a pipeline run

example create temporary view and view

automatic dependency resolution: declarative pipelins is that pipeline dependencies are automatically parsed, ensures data flows correctly from one step to the next => example by mermaid

comments powered by Disqus
rss facebook twitter github gitlab youtube mail spotify lastfm instagram linkedin google google-plus pinterest medium vimeo stackoverflow reddit quora quora