-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[core] Add Table.uuid method #4213
Conversation
if (catalogEnvironment.uuid() != null) { | ||
return catalogEnvironment.uuid(); | ||
} | ||
return fullName(); |
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.
should at least log warning or add a setting to enabling simply use fullName()
as uuid()
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.
We must let this method work at least. Log will produce many logs for filesystem catalog.
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.
Maybe we can find better implementation for non-hive catalog tables. And system tables.
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.
Only 2 small questions
if (catalogEnvironment.uuid() != null) { | ||
return catalogEnvironment.uuid(); | ||
} | ||
long earliestCreationTime = schemaManager().earliestCreationTime(); |
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.
will this earliestCreationTime change as we do compaction or snapshot expire?
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.
Never, actually we do not clean schema files, so the first schema file (schema-0) will always exist, and immutable.
So this earliestCreationTime should always be the same.
catalog.createTable(identifier, DEFAULT_TABLE_SCHEMA, false); | ||
Table table = catalog.getTable(identifier); | ||
String uuid = table.uuid(); | ||
assertThat(uuid).startsWith(identifier.getFullName() + "."); |
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.
This will fail those non-FileStoreTable, right?
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
LGTM, +1, let's merge this! |
Purpose
Add Table.uuid method for table uniq id, this can be used like some RBAC support.
Tests
API and Format
Documentation