Uh oh!
There was an error while loading. Please reload this page.
[SPARK-28178][SQL] DataSourceV2: DataFrameWriter.insertInfo - #24980
[SPARK-28178][SQL] DataSourceV2: DataFrameWriter.insertInfo#24980jzhuge wants to merge 2 commits into
Conversation
SparkQA
commented
Jun 27, 2019
Test build #106958 has finished for PR 24980 at commit
|
SparkQA
commented
Jun 27, 2019
Test build #106971 has finished for PR 24980 at commit
|
SparkQA
commented
Jun 27, 2019
Test build #106972 has finished for PR 24980 at commit
|
SparkQA
commented
Jul 3, 2019
Test build #107140 has finished for PR 24980 at commit
|
SparkQA
commented
Jul 3, 2019
Test build #107143 has finished for PR 24980 at commit
|
dongjoon-hyun
commented
Jul 8, 2019
Retest this please. |
SparkQA
commented
Jul 8, 2019
Test build #107313 has finished for PR 24980 at commit
|
SparkQA
commented
Jul 26, 2019
Test build #108235 has finished for PR 24980 at commit
|
jzhuge
commented
Jul 27, 2019
@dongjoon-hyun@brkyvz@cloud-fan@rdblue This PR is ready for review. It is a follow-up to DSv2 INSERT INTO. |
| assertNotBucketed("insertInto") | ||
| if (partitioningColumns.isDefined) { |
There was a problem hiding this comment.
shall we move these 2 checks to the public insertTo method, instead of duplicating it in the 2 private methods?
| } | ||
| } | ||
| test("insertInto: append partitioned table - dynamic clause") { |
There was a problem hiding this comment.
what do you mean by dynamic clause?
There was a problem hiding this comment.
This is a copy-paste issue. I will remove " - dynamic clause" from the title. insertInto does not have anything similar to INSERT INTO's PARTITION clause.
SparkQA
commented
Jul 29, 2019
Test build #108338 has finished for PR 24980 at commit
|
cloud-fan
commented
Jul 30, 2019
thanks, merging to master! |
jzhuge
commented
Jul 30, 2019
Thanks @cloud-fan ! |
| val command = modeForDSV2 match { | ||
| case SaveMode.Append => | ||
| AppendData.byName(table, df.logicalPlan) |
There was a problem hiding this comment.
I missed it. If you look at the doc of insertInto, it says
* Inserts the content of the `DataFrame` to the specified table. It requires that
* the schema of the `DataFrame` is the same as the schema of the table.
*
* @note Unlike `saveAsTable`, `insertInto` ignores the column names and just uses position-based
* resolution. For example:
We should use byPosition here.
There was a problem hiding this comment.
Agreed. This is an oversight and should be by position.
There was a problem hiding this comment.
Thanks @cloud-fan@rdblue. I will submit a hotfix.
There was a problem hiding this comment.
I can create a follow-up PR to introduce an option matchByName, default to false. If true, insertInto uses byName; otherwise, byPosition.
Maybe even included in this PR?
There was a problem hiding this comment.
If we are going to create a new dataframe writer API in the future, I'd like to keep it as it is, and always do by-position in this insertInto.
There was a problem hiding this comment.
If we are going to create a new dataframe writer API in the future, I'd like to keep it as it is, and always do by-position in this insertInto.
Sounds good to me. I'll submit a PR for the new API.
There was a problem hiding this comment.
@rdblue@cloud-fan@dongjoon-hyun#25353 is ready for review.
What changes were proposed in this pull request?
Support multiple catalogs in the following InsertInto use cases:
Support matrix:
How was this patch tested?
New tests.
All existing catalyst and sql/core tests.