suhuruli commented on code in PR #60580:
URL: https://github.com/apache/spark/pull/60580#discussion_r4649917170


##########
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 agree that the spec should describe the pipeline and not the environment, 
so I removed the spec edit from "Choosing a Target Format" in 
`docs/declarative-pipelines-programming-guide.md`: the spec stays as 
`spark-pipelines init` writes it (`name`, `storage`, `libraries`). The guide 
now tells the reader to run the pipeline against a Spark Connect server with 
`--remote`, and the example commands use `--remote sc://localhost:15002`. The 
connector catalog is set on the server, with `spark.sql.catalog.lakehouse` and 
`spark.sql.defaultCatalog=lakehouse`, as `--conf` on 
`sbin/start-connect-server.sh` or as lines in `conf/spark-defaults.conf`; I 
used that file because it is the one the Spark configuration docs name for 
server settings. On the format, the guide says that a table in a connector 
catalog takes the format its connector gives it, so the connector should be one 
whose tables support row-level operations, such as Iceberg, and that tables the 
session catalog creates without a form
 at use `spark.sql.sources.default`, which is Parquet unless set. The message 
`spark-pipelines` prints for the in-memory session catalog now gives the same 
advice: it suggests `--conf spark.sql.defaultCatalog=<name>` on the server 
where it used to suggest `catalog` in the spec. I have not changed 
`spark-pipelines` to refuse to start without a Spark Connect server: today it 
prints a message and runs against a local server it starts itself, and a 
refusal would break existing invocations, so I would like to settle that 
separately before changing it here.



-- 
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]

Reply via email to