andreaschat-db commented on code in PR #55278:
URL: https://github.com/apache/spark/pull/55278#discussion_r3159830062
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/statements.scala:
##########
@@ -188,7 +188,11 @@ case class InsertIntoStatement(
byName: Boolean = false,
replaceCriteriaOpt: Option[InsertReplaceCriteria] = None,
withSchemaEvolution: Boolean = false)
- extends UnaryParsedStatement {
+ // Extends TransactionalWrite so that QueryExecution can detect a potential
transaction on the
+ // unresolved logical plan before analysis runs. InsertIntoStatement is
shared between V1 and V2
+ // inserts, but the LookupCatalog.TransactionalWrite extractor only matches
when the target
+ // catalog implements TransactionalCatalogPlugin, so V1 inserts are never
assigned a transaction.
+ extends UnaryParsedStatement with TransactionalWrite {
Review Comment:
Unfortunate indeed. I do not like at all that we are mixing v1 with v2 here
but I thought refactoring this is out of the context of this PR.
> Am I right that we sometimes create AppendData directly and some times go
via statement?
Yes. Dataframe API creates directly `AppendData`.
--
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]