Github user davies commented on a diff in the pull request:
https://github.com/apache/spark/pull/15515#discussion_r84770481
--- 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 --
Should we return createCmd (also check recoverPartitionCmd)? Putting them
together looks weird.
---
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]