anew commented on code in PR #60580:
URL: https://github.com/apache/spark/pull/60580#discussion_r4648362852
##########
docs/declarative-pipelines-programming-guide.md:
##########
@@ -683,13 +683,18 @@ operations. AutoCDC requires a target backed by a
connector that supports MERGE.
Auto CDC needs a table provider that implements row-level operations,
configured as a catalog in the pipeline. Lakehouse connectors such as Apache
Iceberg are the usual choice; consult the connector's documentation for whether
it implements the DSv2 row-level operation interfaces and how to register its
catalog. Supporting the `MERGE INTO` SQL statement is not on its own
sufficient: a connector can implement MERGE through its own planner extension
without implementing the DSv2 interface Auto CDC requires. The catalog must
also persist metadata across runs, per [Requirements](#requirements).
-The examples below use a catalog named `lakehouse` to stand in for such a
connector. Add the catalog to the generated `spark-pipeline.yml` - substituting
the catalog name and connector class - without disturbing the `name`,
`storage`, and `libraries` values `spark-pipelines init` already wrote:
+The examples below use a catalog named `lakehouse` to stand in for such a
connector. Edit the generated `spark-pipeline.yml` to select it, substituting
the catalog name and connector class. Keep the `name`, `storage`, and
`libraries` values `spark-pipelines init` wrote, add `catalog` and `database`
as new top-level keys, and add a `configuration` mapping that holds the
connector's `spark.sql.catalog.lakehouse` key. A spec has one `configuration`
mapping: the spec loader keeps only the last of two top-level keys with the
same name, so settings in a second mapping are dropped without an error. If the
spec already has a `configuration` mapping, add the key to it. The edited spec
looks like this:
```yaml
-catalog: lakehouse
-database: cdc_demo
+name: cdc_demo
+storage: file:///path/to/cdc_demo/pipeline-storage
+libraries:
+ - glob:
+ include: transformations/**
configuration:
spark.sql.catalog.lakehouse: <your connector's catalog class>
Review Comment:
I don't think this is the best advice, the pipeline.yaml should describe the
pipeline itself, not the environment that it is run in. Instead, I think we
should recommend:
- run spark-pipelines only against a Spark Connect server, that is, with
`--remote "sc://server:port"` (in a local setup, typically `localhost:15002`).
- with Spark Connect, only the server needs to configure the catalog
implementation. Configure your Spark Connect server to use a catalog that
persists metadata across restarts, for example, Hive or UC. That configuration
should be in the spark-site.xml so that it does not need to be provided on the
command line.
- furthermore, we should recommend using a default file format that supports
row level updates such as Iceberg. Without that, AutoCDC will not work.
In addition, we should refuse to start up if not using Spark Connect.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]