-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-33505][SQL][TESTS] Fix adding new partitions by INSERT INTO InMemoryPartitionTable
#30449
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
Conversation
Test build #131438 has finished for PR 30449 at commit
|
sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala
Outdated
Show resolved
Hide resolved
Thanks, @MaxGekk . |
I think it would be nice to check that insert into the same partition doesn't fail. I will add one more |
Kubernetes integration test starting |
Kubernetes integration test status success |
Kubernetes integration test starting |
sql(s"INSERT INTO $t PARTITION(id = 1, city = 'NY') SELECT 'abc'") | ||
assert(partTable.partitionExists(expectedPartitionIdent)) | ||
// Insert into the existing partition must not fail | ||
sql(s"INSERT INTO $t PARTITION(id = 1, city = 'NY') SELECT 'def'") |
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.
Yep. Good to have. +1.
Kubernetes integration test status failure |
Test build #131439 has finished for PR 30449 at commit
|
Test build #131443 has finished for PR 30449 at commit
|
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.
+1, LGTM. Thanks, @MaxGekk .
Merged to master.
What changes were proposed in this pull request?
addPartitionKey()
ofInMemoryTable
which is called per every row.addPartitionKey()
inInMemoryPartitionTable
, and add partition key every time when new row is inserted to the table.Why are the changes needed?
To be able to write unified tests for datasources V1 and V2. Currently, INSERT INTO a V1 table creates partitions but the same doesn't work for the custom catalog
InMemoryPartitionTableCatalog
used in DSv2 tests.Does this PR introduce any user-facing change?
No
How was this patch tested?
By running the affected test suite
DataSourceV2SQLSuite
.