[SPARK-49152][SQL] V2SessionCatalog should use V2Command#47660
Closed
amaliujia wants to merge 13 commits intoapache:masterfrom
Closed
[SPARK-49152][SQL] V2SessionCatalog should use V2Command#47660amaliujia wants to merge 13 commits intoapache:masterfrom
amaliujia wants to merge 13 commits intoapache:masterfrom
Conversation
Author
cloud-fan
reviewed
Aug 8, 2024
e85a419 to
69614d1
Compare
cloud-fan
reviewed
Aug 9, 2024
cloud-fan
reviewed
Aug 9, 2024
cloud-fan
reviewed
Aug 9, 2024
cloud-fan
reviewed
Aug 9, 2024
cloud-fan
reviewed
Aug 9, 2024
cloud-fan
reviewed
Aug 9, 2024
cloud-fan
reviewed
Aug 9, 2024
a86341f to
250a4ae
Compare
cloud-fan
reviewed
Aug 12, 2024
| import DataSourceV2Implicits._ | ||
| import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._ | ||
|
|
||
| lazy private val hadoopConf = session.sparkContext.hadoopConfiguration |
Contributor
There was a problem hiding this comment.
this shouldn't be lazy val, we should call SessionState.newHadoopConf
cloud-fan
reviewed
Aug 12, 2024
cloud-fan
reviewed
Aug 12, 2024
cloud-fan
reviewed
Aug 12, 2024
…/ResolveSessionCatalog.scala Co-authored-by: Wenchen Fan <cloud0fan@gmail.com>
Contributor
|
thanks, merging to master! |
amaliujia
pushed a commit
to amaliujia/spark
that referenced
this pull request
Aug 12, 2024
V2SessionCatalog should use V2Command when possible. This is because the session catalog can be overwritten thus the overwritten's catalog should use v2 commands, otherwise the V1Command will still call hive metastore or the built-in session catalog. No Existing tests. NO Closes apache#47660 from amaliujia/create_table_v2. Authored-by: Rui Wang <rui.wang@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
cloud-fan
reviewed
Aug 14, 2024
| private def qualifyLocInTableSpec(tableSpec: TableSpec): TableSpec = { | ||
| tableSpec.withNewLocation(tableSpec.location.map(makeQualifiedDBObjectPath(_))) | ||
| tableSpec.withNewLocation(tableSpec.location.map(loc => CatalogUtils.makeQualifiedPath( | ||
| CatalogUtils.stringToURI(loc), hadoopConf).toString)) |
Contributor
There was a problem hiding this comment.
we should follow v1 command code path and call CatalogUtils.URIToString to get the path string.
dongjoon-hyun
pushed a commit
that referenced
this pull request
Aug 14, 2024
…ath string ### What changes were proposed in this pull request? This is a followup of #47660 to restore the behavior change. The table location string should be Hadoop Path string instead of URL string which escapes all special chars. ### Why are the changes needed? restore the unintentional behavior change. ### Does this PR introduce _any_ user-facing change? No, it's not released yet ### How was this patch tested? new test ### Was this patch authored or co-authored using generative AI tooling? no Closes #47759 from cloud-fan/fix. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
cloud-fan
added a commit
to cloud-fan/spark
that referenced
this pull request
Aug 15, 2024
…ath string This is a followup of apache#47660 to restore the behavior change. The table location string should be Hadoop Path string instead of URL string which escapes all special chars. restore the unintentional behavior change. No, it's not released yet new test no Closes apache#47759 from cloud-fan/fix. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
cloud-fan
added a commit
that referenced
this pull request
Aug 15, 2024
…oop Path string ### What changes were proposed in this pull request? This is a followup of #47660 to restore the behavior change. The table location string should be Hadoop Path string instead of URL string which escapes all special chars. ### Why are the changes needed? restore the unintentional behavior change. ### Does this PR introduce _any_ user-facing change? No, it's not released yet ### How was this patch tested? new test ### Was this patch authored or co-authored using generative AI tooling? no Closes #47765 from cloud-fan/fix. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
cloud-fan
added a commit
that referenced
this pull request
Sep 5, 2024
…se V1 commands ### What changes were proposed in this pull request? This is a followup of #47660 . If users override `spark_catalog` with `DelegatingCatalogExtension`, we should still use v1 commands as `DelegatingCatalogExtension` forwards requests to HMS and there are still behavior differences between v1 and v2 commands targeting HMS. This PR also forces to use v1 commands for certain commands that do not have a v2 version. ### Why are the changes needed? Avoid introducing behavior changes to Spark plugins that implements `DelegatingCatalogExtension` to override `spark_catalog`. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? new test case ### Was this patch authored or co-authored using generative AI tooling? No Closes #47995 from amaliujia/fix_catalog_v2. Lead-authored-by: Wenchen Fan <wenchen@databricks.com> Co-authored-by: Rui Wang <rui.wang@databricks.com> Co-authored-by: Wenchen Fan <cloud0fan@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
cloud-fan
added a commit
that referenced
this pull request
Sep 5, 2024
…se V1 commands ### What changes were proposed in this pull request? This is a followup of #47660 . If users override `spark_catalog` with `DelegatingCatalogExtension`, we should still use v1 commands as `DelegatingCatalogExtension` forwards requests to HMS and there are still behavior differences between v1 and v2 commands targeting HMS. This PR also forces to use v1 commands for certain commands that do not have a v2 version. ### Why are the changes needed? Avoid introducing behavior changes to Spark plugins that implements `DelegatingCatalogExtension` to override `spark_catalog`. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? new test case ### Was this patch authored or co-authored using generative AI tooling? No Closes #47995 from amaliujia/fix_catalog_v2. Lead-authored-by: Wenchen Fan <wenchen@databricks.com> Co-authored-by: Rui Wang <rui.wang@databricks.com> Co-authored-by: Wenchen Fan <cloud0fan@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit f7cfeb5) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
sunchao
pushed a commit
that referenced
this pull request
Mar 10, 2026
…oop Path string ### What changes were proposed in this pull request? This is a followup of #47660 to restore the behavior change. The table location string should be Hadoop Path string instead of URL string which escapes all special chars. ### Why are the changes needed? restore the unintentional behavior change. ### Does this PR introduce _any_ user-facing change? No, it's not released yet ### How was this patch tested? new test ### Was this patch authored or co-authored using generative AI tooling? no Closes #47765 from cloud-fan/fix. Authored-by: Wenchen Fan <wenchen@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
sunchao
pushed a commit
that referenced
this pull request
Mar 10, 2026
…se V1 commands ### What changes were proposed in this pull request? This is a followup of #47660 . If users override `spark_catalog` with `DelegatingCatalogExtension`, we should still use v1 commands as `DelegatingCatalogExtension` forwards requests to HMS and there are still behavior differences between v1 and v2 commands targeting HMS. This PR also forces to use v1 commands for certain commands that do not have a v2 version. ### Why are the changes needed? Avoid introducing behavior changes to Spark plugins that implements `DelegatingCatalogExtension` to override `spark_catalog`. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? new test case ### Was this patch authored or co-authored using generative AI tooling? No Closes #47995 from amaliujia/fix_catalog_v2. Lead-authored-by: Wenchen Fan <wenchen@databricks.com> Co-authored-by: Rui Wang <rui.wang@databricks.com> Co-authored-by: Wenchen Fan <cloud0fan@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit f7cfeb5) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
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?
V2SessionCatalog should use V2Command when possible.
Why are the changes needed?
This is because the session catalog can be overwritten thus the overwritten's catalog should use v2 commands, otherwise the V1Command will still call hive metastore or the built-in session catalog.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Existing tests.
Was this patch authored or co-authored using generative AI tooling?
NO