cloud-fan commented on a change in pull request #30806:
URL: https://github.com/apache/spark/pull/30806#discussion_r545059579
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/DataSourceV2Strategy.scala
##########
@@ -188,15 +189,20 @@ class DataSourceV2Strategy(session: SparkSession) extends
Strategy with Predicat
orCreate = orCreate) :: Nil
}
- case AppendData(r: DataSourceV2Relation, query, writeOptions, _) =>
+ case AppendData(r: DataSourceV2Relation, query, writeOptions, _, write) =>
Review comment:
+1 to this idea. It's guaranteed that the `write` will be `Some` not
`None` at the planner, so matching `Some(write)` is better.
It's possible that the implementation declares `V1_BATCH_WRITE` but doesn't
return `V1Write`. We should give clear error message if it happens:
```
case AppendData(r @ DataSourceV2Relation(v1: SupportsWrite, _, _, _, _),
query, writeOptions,
_, Some(write)) if v1.supports(TableCapability.V1_BATCH_WRITE) =>
if (!write.isInstanceOf[V1Write]) throw ...
...
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]