Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/12239#discussion_r62155721
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
---
@@ -347,10 +347,23 @@ case class InsertIntoTable(
override def children: Seq[LogicalPlan] = child :: Nil
override def output: Seq[Attribute] = Seq.empty
+ private[spark] lazy val expectedColumns = {
+ if (table.output.isEmpty) {
+ None
+ } else {
+ val numDynamicPartitions = partition.values.count(_.isEmpty)
+ val (partitionColumns, dataColumns) = table.output
+ .partition(a => partition.keySet.contains(a.name))
+ Some(dataColumns ++ partitionColumns.takeRight(numDynamicPartitions))
+ }
--- End diff --
Seems that we can omit the `if` condition and just use a `Seq[Attribute]`
instead of `Option[Seq[Attribute]]` here?
---
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]