rdblue commented on a change in pull request #3661:
URL: https://github.com/apache/iceberg/pull/3661#discussion_r768031250
##########
File path:
spark/v3.2/spark-extensions/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ExtendedV2Writes.scala
##########
@@ -90,6 +93,14 @@ object ExtendedV2Writes extends Rule[LogicalPlan] with
PredicateHelper {
}
val newQuery = ExtendedDistributionAndOrderingUtils.prepareQuery(write,
query, conf)
o.copy(write = Some(write), query = newQuery)
+
+ case rd @ ReplaceData(r: DataSourceV2Relation, query, _, None) =>
+ val rowSchema = StructType.fromAttributes(rd.dataInput)
+ val writeBuilder = newWriteBuilder(r.table, rowSchema, Map.empty)
+ val write = writeBuilder.build()
+ // TODO: detect when query contains a shuffle and insert a round-robin
repartitioning
Review comment:
I'm inclined to leave it out. If we need it, we can add it later. It is
also something that Spark users are already familiar with adding manually
because there are many situations that require one. Just writing a clustered
data set to a table by adding a global sort commonly requires manually adding a
repartition.
--
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]