-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Kernel] [CC Refactor #1] Add TableIdentifier
API
#3795
Conversation
@@ -269,6 +290,22 @@ public long getVersionAtOrAfterTimestamp(Engine engine, long millisSinceEpochUTC | |||
} | |||
} | |||
|
|||
//////////////////// | |||
// Protected APIs // |
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.
protected APIs should be below public APIs
this.tablePath = tablePath; | ||
final Path dataPath = new Path(tablePath); | ||
final Path logPath = new Path(dataPath, "_delta_log"); |
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 were duplicating this Path creation in the getDataPath
and getLogPath
methods. might as well just save them as instance variables.
@@ -169,8 +199,7 @@ public CloseableIterator<ColumnarBatch> getChanges( | |||
for (int rowId = 0; rowId < protocolVector.getSize(); rowId++) { | |||
if (!protocolVector.isNullAt(rowId)) { | |||
Protocol protocol = Protocol.fromColumnVector(protocolVector, rowId); | |||
TableFeatures.validateReadSupportedTable( | |||
protocol, getDataPath().toString(), Optional.empty()); | |||
TableFeatures.validateReadSupportedTable(protocol, tablePath, Optional.empty()); |
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.
getDataPath().toString
is the same as tablePath
kernel/kernel-api/src/main/java/io/delta/kernel/TableIdentifier.java
Outdated
Show resolved
Hide resolved
kernel/kernel-api/src/main/java/io/delta/kernel/TableIdentifier.java
Outdated
Show resolved
Hide resolved
* @return the table identifier, or {@link Optional#empty()} if none is set. | ||
* @since 3.3.0 | ||
*/ | ||
Optional<TableIdentifier> getTableIdentifier(Engine engine); |
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 thought we wanted to remove the Engine
as arg to APIs going forward.
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.
Yup! We do. We should do that in one final pass. Until then, I'm going to stick with the current convention.
kernel/kernel-api/src/main/java/io/delta/kernel/TableIdentifier.java
Outdated
Show resolved
Hide resolved
kernel/kernel-api/src/main/java/io/delta/kernel/TableIdentifier.java
Outdated
Show resolved
Hide resolved
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.
LGTM
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.
LGTM but please add java docs
f373f74
to
188f144
Compare
188f144
to
768e637
Compare
Which Delta project/connector is this regarding?
Description
TableIdentifier
class, that kernel will pass on to Commit Coordinator ClientTable::forPathWithTableId(engine, path, tableId)
interfaceOptional
in theTable
, and this PR does not propagate that value into SnapshotManager, Snapshot, etc. Future PRs can take care of that.How was this patch tested?
TableIdentifier UTs
Does this PR introduce any user-facing changes?
Yes. See the above.