[SPARK-29908][SQL] Alternative proposal for supporting partitioning through save for V2 tables#25833
Closed
brkyvz wants to merge 1 commit intoapache:masterfrom
Closed
[SPARK-29908][SQL] Alternative proposal for supporting partitioning through save for V2 tables#25833brkyvz wants to merge 1 commit intoapache:masterfrom
brkyvz wants to merge 1 commit intoapache:masterfrom
Conversation
|
Test build #110927 has finished for PR 25833 at commit
|
Member
|
Hi, @brkyvz . This seems to break the compilation. Could you take a look? |
Contributor
Author
Contributor
Author
|
Another option is that a V2 DataSource doesn't need to extend |
rdblue
reviewed
Sep 18, 2019
| extraOptions.toMap, | ||
| orCreate = true) // Create the table if it doesn't exist | ||
|
|
||
| case (other, _) => |
Contributor
There was a problem hiding this comment.
Why not use AppendData when mode is append?
rdblue
reviewed
Sep 18, 2019
| */ | ||
| @Experimental | ||
| public interface TableCatalog extends CatalogPlugin { | ||
| public interface TableCatalog extends CatalogPlugin, SupportCreateTable { |
Contributor
There was a problem hiding this comment.
Why do tables managed by a TableProvider not require invalidateTable?
rdblue
reviewed
Sep 18, 2019
| } else if (paths.isEmpty) { | ||
| throw new IllegalArgumentException("Didn't specify the 'path' for file based table") | ||
| } | ||
| Identifier.of(Array.empty, paths.head) |
Contributor
There was a problem hiding this comment.
This should be a different class, PathIdentifier, so that we can easily identify these and handle them separately.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
This is an alternative proposal to #25822 and #25651. The problem we're trying to solve is that when a catalog doesn't exist when using a data source, there is no good way to create a V2 table with partitioning and table property information. Spark users have been using data source options to connect to such data sources such as Kafka, JDBC tables through data source options, and it should be possible to continue to create tables as such.
This PR introduces a couple interfaces:
SupportsCreateTableandSupportsIdentifierTranslation.SupportsCreateTableare the parts that existed inTableCatalogthat are related to the creation/dropping of tables. This is pulled out, andTableCatalogextends this interface.SupportsIdentifierTranslationis a way for data sources to go from data source options to an internal identifier that can be used to describe how to access that table. ATableProvidercan extendSupportsIdentifierTranslationandSupportsCreateTableto be able to support the creation of tables without requiring an explicit catalog.This would:
DataFrameWriter.savewhen passing in partitioning information to data sourcesErrorIfExistsandIgnoreto be supported forDataFrameWriter.saveDataFrameWriterV2Why are the changes needed?
DataFrameWriter.saveis broken for all data sources that want to get partitioning information and support differentSaveModes that migrate from DataSource V1 to V2 APIs.Does this PR introduce any user-facing change?
The behavior of a DataSource that used to be DataSource V1 in Spark 2.4 can behave identically with DataSource V2 in Spark 3.0.
How was this patch tested?
Will add tests after comments