Github user nongli commented on a diff in the pull request:
https://github.com/apache/spark/pull/10498#discussion_r48588647
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/WriterContainer.scala
---
@@ -317,14 +318,39 @@ private[sql] class DynamicPartitionWriterContainer(
isAppend: Boolean)
extends BaseWriterContainer(relation, job, isAppend) {
+ private def toAttribute(columnName: String) = inputSchema.find(_.name ==
columnName).get
+
def writeRows(taskContext: TaskContext, iterator:
Iterator[InternalRow]): Unit = {
val outputWriters = new java.util.HashMap[InternalRow, OutputWriter]
executorSideSetup(taskContext)
var outputWritersCleared = false
- // Returns the partition key given an input row
- val getPartitionKey = UnsafeProjection.create(partitionColumns,
inputSchema)
+ val getKey = if (bucketSpec.isEmpty) {
--- End diff --
This logic is a bit dense. Might be nice to add a quick comment with how
you are setting these up.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]