Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/15515#discussion_r85415502
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala ---
@@ -387,7 +388,15 @@ final class DataFrameWriter[T] private[sql](ds:
Dataset[T]) {
partitionColumnNames = partitioningColumns.getOrElse(Nil),
bucketSpec = getBucketSpec
)
- val cmd = CreateTable(tableDesc, mode, Some(df.logicalPlan))
+ val createCmd = CreateTable(tableDesc, mode, Some(df.logicalPlan))
+ val cmd = if (tableDesc.partitionColumnNames.nonEmpty &&
+ df.sparkSession.sqlContext.conf.manageFilesourcePartitions) {
+ // Need to recover partitions into the metastore so our saved
data is visible.
+ val recoverPartitionCmd =
AlterTableRecoverPartitionsCommand(tableDesc.identifier)
+ Union(createCmd, recoverPartitionCmd)
--- End diff --
Let's add a special node for running a sequence of commands. We are relying
on the implementation of Union at here. Let's address this in a follow-up PR.
---
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]