Skip to content

Conversation

@yili-db
Copy link
Collaborator

@yili-db yili-db commented Dec 1, 2025

Which Delta project/connector is this regarding?

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

Description

[Spark] Translate old property ucTableId to io.unitycatalog.tableId when creating a new table.

This table property was renamed by #5534. However caller to AbstractDeltaCatalog.createTable (UCSingleCatalog from unitycatalog-spark) still sets the old property name and new property name in its current release. This change is needed until UCSingleCatalog moves away from the old table property name.

How was this patch tested?

A test is added in DeltaDDLSuite to exercise the table creation with old property name.

Does this PR introduce any user-facing changes?

No.

@yili-db yili-db force-pushed the property_translate branch 2 times, most recently from eab335e to 4b812f3 Compare December 1, 2025 23:44
if (DeltaSourceUtils.isDeltaDataSourceName(getProvider(properties))) {
// TODO: we should extract write options from table properties for all the cases. We
// can remove the UC check when we have confidence.
val respectOptions = isUnityCatalog || properties.containsKey("test.simulateUC")
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the original intention for the test.simulateUC? Seems like it's for testing purposes, but do you know more about the context ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it's just for testing purpose in test test("CREATE TABLE with OPTIONS").
In the new test I added I also used it.

properties: util.Map[String, String]) : Table =
recordFrameProfile("DeltaCatalog", "createTable") {
if (DeltaSourceUtils.isDeltaDataSourceName(getProvider(properties))) {
// TODO: we should extract write options from table properties for all the cases. We
Copy link
Collaborator

Choose a reason for hiding this comment

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

I will invite @cloud-fan to help co-review this PR, since he left this TODO comments.

*/
private def translateCatalogOwnedFeature(props: util.Map[String, String]): Unit = {
val removedValue = Option(props.remove(CatalogOwnedTableFeature.oldPropertyKey))
removedValue.foreach(props.putIfAbsent(CatalogOwnedTableFeature.propertyKey, _))
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the value of the CatalogOwnedTableFeature.propertyKey ? I did not see it in the codebase...

Copy link
Collaborator Author

@yili-db yili-db Dec 3, 2025

Choose a reason for hiding this comment

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

I have added this as a val of TableFeature. It's:

  /** The table property config key. */
  val propertyKey: String = TableFeatureProtocolUtils.propertyKey(name)

And its specific value is delta.feature.catalogManaged

/**
* The table feature CatalogOwnedTableFeature was once renamed from an old name. In a transition
* period we need to translate the old table feature property name set by caller to new one.
* TODO: clean up once callers are migrated.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to explain what are the version that we need to keep this for the compatibility issue ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Primarily for UC-Spark 0.3.1. But it doesn't exist yet so I hesitated to put the specific number in comment.

@yili-db yili-db requested a review from openinx December 3, 2025 20:55
@yili-db yili-db force-pushed the property_translate branch from 8aa9f99 to 5a86d6c Compare December 5, 2025 07:49
@yili-db yili-db force-pushed the property_translate branch from 5a86d6c to c2f7080 Compare December 9, 2025 22:39
@yili-db yili-db changed the title [Spark] Translate old table feature catalogOwned-preview to catalogManaged when creating a new table. [Spark] Translate old property ucTableId to io.unitycatalog.tableId when creating a new table. Dec 9, 2025
@tdas tdas merged commit da0c2ae into delta-io:master Dec 10, 2025
14 checks passed
TimothyW553 pushed a commit to TimothyW553/delta that referenced this pull request Dec 10, 2025
…hen creating a new table. (delta-io#5609)

#### Which Delta project/connector is this regarding?
- [X] Spark
- [ ] Standalone
- [ ] Flink
- [ ] Kernel
- [ ] Other (fill in here)

## Description
[Spark] Translate old property ucTableId to io.unitycatalog.tableId when
creating a new table.

This table property was renamed by
delta-io#5534. However caller to
AbstractDeltaCatalog.createTable (UCSingleCatalog from
unitycatalog-spark) still sets the old property name and new property
name in its current release. This change is needed until UCSingleCatalog
moves away from the old table property name.

## How was this patch tested?
A test is added in DeltaDDLSuite to exercise the table creation with old
property name.

## Does this PR introduce _any_ user-facing changes?
No.

---------

Signed-off-by: Yi Li <[email protected]>
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