aokolnychyi commented on code in PR #55623:
URL: https://github.com/apache/spark/pull/55623#discussion_r3190432006
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -1064,6 +1064,8 @@ class Analyzer(
table: NamedRelation,
withNewTable: NamedRelation => LogicalPlan): LogicalPlan = {
table match {
+ // Streaming write targets are constructed with isStreaming=false even
inside a streaming
+ // query, because the sink is a regular batch write destination.
case u: UnresolvedRelation if !u.isStreaming =>
Review Comment:
Don't you create `UnresolvedRelation` in `MicroBatchExecution` and control
the flag?
Also, I am not sure it is a good idea to use `UnresolvedRelation` in the
streaming template plan. It means we will re-resolve the target table on each
batch and will not be able to detect that the table changed (e.g. dropped and
recreated). I believe a better solution would be to use `V2TableReference` with
a new write context (say `WriteTargetContext`). That way you can insert needed
validation for each batch.
--
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]