-
Notifications
You must be signed in to change notification settings - Fork 2k
[Spark] Translate old property ucTableId to io.unitycatalog.tableId when creating a new table. #5609
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
eab335e to
4b812f3
Compare
| 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") |
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.
What's the original intention for the test.simulateUC? Seems like it's for testing purposes, but do you know more about the context ?
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.
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 |
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.
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, _)) |
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.
What's the value of the CatalogOwnedTableFeature.propertyKey ? I did not see it in the codebase...
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.
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. |
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.
Do we need to explain what are the version that we need to keep this for the compatibility issue ?
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.
Primarily for UC-Spark 0.3.1. But it doesn't exist yet so I hesitated to put the specific number in comment.
8aa9f99 to
5a86d6c
Compare
…en creating a new table. Signed-off-by: Yi Li <[email protected]>
Signed-off-by: Yi Li <[email protected]>
5a86d6c to
c2f7080
Compare
…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]>
Which Delta project/connector is this regarding?
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.