[GitHub] spark pull request #15983: [SPARK-18544] [SQL] Append with df.saveAsTable wr...

2016-11-28 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/15983


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #15983: [SPARK-18544] [SQL] Append with df.saveAsTable wr...

2016-11-22 Thread cloud-fan
Github user cloud-fan commented on a diff in the pull request:

https://github.com/apache/spark/pull/15983#discussion_r89256222
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala ---
@@ -373,8 +373,19 @@ final class DataFrameWriter[T] private[sql](ds: 
Dataset[T]) {
 throw new AnalysisException(s"Table $tableIdent already exists.")
 
   case _ =>
-val storage = 
DataSource.buildStorageFormatFromOptions(extraOptions.toMap)
-val tableType = if (storage.locationUri.isDefined) {
+val existingTable = if (tableExists) {
--- End diff --

shall we move this logic in `CreateDataSourceTableAsSelectCommand`?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #15983: [SPARK-18544] [SQL] Append with df.saveAsTable wr...

2016-11-22 Thread ericl
Github user ericl commented on a diff in the pull request:

https://github.com/apache/spark/pull/15983#discussion_r89242144
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala ---
@@ -391,12 +396,6 @@ final class DataFrameWriter[T] private[sql](ds: 
Dataset[T]) {
 )
 df.sparkSession.sessionState.executePlan(
   CreateTable(tableDesc, mode, Some(df.logicalPlan))).toRdd
-if (tableDesc.partitionColumnNames.nonEmpty &&
--- End diff --

I think this is unnecessary since the create / insert commands already 
recover partitions themselves. We'll see if any tests fail.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #15983: [SPARK-18544] [SQL] Append with df.saveAsTable wr...

2016-11-22 Thread ericl
GitHub user ericl opened a pull request:

https://github.com/apache/spark/pull/15983

[SPARK-18544] [SQL] Append with df.saveAsTable writes data to wrong location

## What changes were proposed in this pull request?

We failed to properly propagate table metadata for existing tables for the 
saveAsTable command. This caused a downstream component to think the table was 
MANAGED, writing data to the wrong location.

## How was this patch tested?

Unit tests.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ericl/spark spark-18544

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/spark/pull/15983.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #15983


commit 39b6249de5ff8c17e94da99bbeefe8d978d74cf6
Author: Eric Liang 
Date:   2016-11-23T00:53:53Z

fix it




---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org