-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-5658][SQL] Finalize DDL and write support APIs #4446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
5390743
Add more save APIs to DataFrame.
yhuai 5ffc372
Add more load APIs to SQLContext.
yhuai 43bae01
Remove createTable from HiveContext.
yhuai e6a0b77
Update test.
yhuai 2a6213a
Update API names.
yhuai af9e9b3
DDL and write support API followup.
yhuai ed4e1b4
Merge remote-tracking branch 'upstream/master' into writeSupportFollowup
yhuai b1e9b1b
Format.
yhuai e702386
Apache header.
yhuai f2f33ef
Fix test.
yhuai 6dfd386
Add java test.
yhuai 7db95ff
Merge remote-tracking branch 'upstream/master' into writeSupportFollowup
yhuai cf5703d
Add checkAnswer to Java tests.
yhuai e04d908
Move import and add (Scala-specific) to scala APIs.
yhuai 77d89dc
Update doc.
yhuai 4679665
Remove duplicate rule.
yhuai 99950a2
Use Java enum for SaveMode.
yhuai c2be775
Merge remote-tracking branch 'upstream/master' into writeSupportFollowup
yhuai 9b6e570
Update doc.
yhuai 9ff97d8
Add SaveMode to saveAsTable.
yhuai a10223d
Merge remote-tracking branch 'upstream/master' into writeSupportFollowup
yhuai c204967
Format
yhuai 2bf44ef
Python APIs.
yhuai 98e7cdb
Python style.
yhuai 0832ce4
Fix test.
yhuai 3abc215
Merge remote-tracking branch 'upstream/master' into writeSupportFollowup
yhuai 4c76d78
Simplify APIs.
yhuai d91ecb8
Fix test.
yhuai 22cfa70
Merge remote-tracking branch 'upstream/master' into writeSupportFollowup
yhuai d1c12d3
No need to delete the duplicate rule since it has been removed in mas…
yhuai cbc717f
Rename dataSourceName to source.
yhuai 92b6659
Python doc and other minor updates.
yhuai 609129c
Doc format.
yhuai ae4649e
Fix Python test.
yhuai 537e28f
Correctly clean up temp data.
yhuai 2091fcd
Merge remote-tracking branch 'upstream/master' into writeSupportFollowup
yhuai 2306f93
Style.
yhuai 225ff71
Use Scala TestHiveContext to initialize the Python HiveContext in Pyt…
yhuai f3a96f7
davies's comments.
yhuai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
sql/core/src/main/java/org/apache/spark/sql/sources/SaveMode.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.spark.sql.sources; | ||
|
|
||
| /** | ||
| * SaveMode is used to specify the expected behavior of saving a DataFrame to a data source. | ||
| */ | ||
| public enum SaveMode { | ||
| /** | ||
| * Append mode means that when saving a DataFrame to a data source, if data/table already exists, | ||
| * contents of the DataFrame are expected to be appended to existing data. | ||
| */ | ||
| Append, | ||
| /** | ||
| * Overwrite mode means that when saving a DataFrame to a data source, | ||
| * if data/table already exists, existing data is expected to be overwritten by the contents of | ||
| * the DataFrame. | ||
| */ | ||
| Overwrite, | ||
| /** | ||
| * ErrorIfExists mode means that when saving a DataFrame to a data source, if data already exists, | ||
| * an exception is expected to be thrown. | ||
| */ | ||
| ErrorIfExists, | ||
| /** | ||
| * Ignore mode means that when saving a DataFrame to a data source, if data already exists, | ||
| * the save operation is expected to not save the contents of the DataFrame and to not | ||
| * change the existing data. | ||
| */ | ||
| Ignore | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
tableNamecould be justname.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if we can do it.
tableNamehas been used at lots of places.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw it's only used int insertInto() and saveAsTable(), and registerAsTable() use
name.It's not a keyword argument, so it's safe to change the name.