ericm-db commented on code in PR #47524:
URL: https://github.com/apache/spark/pull/47524#discussion_r1704783685


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/IncrementalExecution.scala:
##########
@@ -242,7 +242,26 @@ class IncrementalExecution(
             metadataWriter.write(metadata)
           case _ =>
         }
-        statefulOp
+        statefulOp match {
+          case tws: TransformWithStateExec =>
+            // create map of columnFamilyName -> columnFamilyId
+            val newSchemas = schemaValidationResult.head.newSchemas
+            val columnFamilySchemas = newSchemas.map { case schema =>
+              schema.colFamilyName -> schema
+            }.toMap
+            StreamExecution.updateColumnFamilySchemas(
+              queryId, runId, columnFamilySchemas)
+            val stateInfo = tws.getStateInfo
+            tws.copy(stateInfo = Some(
+              stateInfo.copy(colFamilySchemas = columnFamilySchemas)))
+          case _ => statefulOp
+        }
+      case tws: TransformWithStateExec =>

Review Comment:
   Ah yeah we could



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to