Skip to content
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

[Spark] Support create external table for clustered table #3251

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

zedtang
Copy link
Collaborator

@zedtang zedtang commented Jun 11, 2024

Which Delta project/connector is this regarding?

  • Spark
  • Standalone
  • Flink
  • Kernel
  • Other (fill in here)

Description

Support creating a clustered table from an external location that already has a clustered table. We follow the same semantics as partitioned tables:

External location already has clustered/partitioned table:

Create clustered/partitioned table partitioned clustered
schema not specified, cluster/partitioned by not specified success success
schema specified, cluster by/partitioned by not specified throw DELTA_CREATE_TABLE_WITH_DIFFERENT_PARTITIONING throw DELTA_CREATE_TABLE_WITH_DIFFERENT_CLUSTERING
schema specified, cluster by/partitioned by different column throw DELTA_CREATE_TABLE_WITH_DIFFERENT_PARTITIONING throw DELTA_CREATE_TABLE_WITH_DIFFERENT_CLUSTERING
schema specified, cluster by/partitioned by same column success success

External location already has non-clustered/non-partitioned table:

Create clustered/partitioned table partitioned clustered
schema specified, cluster by/partitioned by specified throw DELTA_CREATE_TABLE_WITH_DIFFERENT_PARTITIONING throw DELTA_CREATE_TABLE_WITH_DIFFERENT_CLUSTERING

How was this patch tested?

Added new unit tests to cover all scenarios above.

Does this PR introduce any user-facing changes?

No.

Copy link
Contributor

@dabao521 dabao521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@scottsand-db scottsand-db merged commit bb14833 into delta-io:master Jun 11, 2024
9 of 10 checks passed
@zedtang zedtang deleted the create-external-table branch June 11, 2024 18:04
@zedtang zedtang mentioned this pull request Dec 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants