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


##########
sql/pipelines/src/main/scala/org/apache/spark/sql/pipelines/graph/DatasetManager.scala:
##########
@@ -413,6 +413,10 @@ object DatasetManager extends Logging {
           desiredSchema = outputSchema,
           properties = mergedProperties,
           mergeWithExistingSchema = isTableIncrementallyUpdated,
+          // On the incremental path, shared columns take the declared or 
inferred schema's
+          // metadata, so that a changed or removed column comment reaches the 
table as it does on
+          // the non-merging paths (materialized views and full refreshes).
+          mergeWithDesiredMetadata = true,

Review Comment:
   I added the setting you asked for: 
`spark.sql.legacy.pipelines.streamingTable.keepExistingColumnMetadata` 
(internal, boolean, default `false`), and setting it to `true` restores the 
Spark 4.3 behavior where an incremental update of a streaming table keeps the 
column comments the table already has. Only `materializeTable`'s call into 
`evolveTable` reads it, passing `mergeWithDesiredMetadata = false` when it is 
on; materialized views, full refreshes and the AutoCDC auxiliary table are 
unchanged, and the 4.3 to 4.4 migration note names it. `MaterializeTablesSuite` 
covers it in two table-driven tests, `SPARK-59268: re-materializing a streaming 
table with column comment changes` and `SPARK-59268: a comment change under 
consecutive arrays in a streaming table update`, each run with the setting 
`false` and `true`; the `true` cases fail when the setting is not read. Since 
branch-4.4 is already cut, could you confirm whether `.version("4.4.0")` is 
right or it should be `5.0.0`?



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