Skip to content
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] Integrate TableFeature framework in read and write path #4159

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

vkorukanti
Copy link
Collaborator

@vkorukanti vkorukanti commented Feb 14, 2025

Description

This integrates the end-to-end TableFeatures framework in read and write path.

It also adds support for appending into a table with deletionVectors, v2Checkpoint and 'timestampNtz` are supported.

How was this patch tested?

Existing and new tests.

@vkorukanti vkorukanti changed the title Tf integration [Kernel] Integrate TableFeature framework in read and write path Feb 14, 2025
}
}

// Important note: uses the default implementation of `equals` and `hashCode` methods.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense, but would it make sense to move this comment to the class javadoc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

private static class CheckpointV2TableFeature extends TableFeature.ReaderWriterFeature
implements FeatureAutoEnabledByMetadata {
CheckpointV2TableFeature() {
super("v2Checkpoint", /* minReaderVersion = */ 3, /* minWriterVersion = */ 7);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: would it make sense to use the constants like TABLE_FEATURES_MIN_READER_VERSION etc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm. I think keeping constants is fine here, given some of the legacy protocols (e.g. invariants ) have no constants.

*
* @param <V>
*/
public class CaseInsensitiveMap<V> implements Map<String, V> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to call it something like CaseInsensitiveStringMap since the key is always a string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good. Will followup in a separate PR. I am also wondering if this is really needed.

*
* @param <V>
*/
public class CaseInsensitiveMap<V> implements Map<String, V> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to implement equals and hashCode?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same comment as above.

Copy link
Collaborator

@scottsand-db scottsand-db left a comment

Choose a reason for hiding this comment

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

Looks great! Left some minor comments and asked some questions.

.withFeatures(extractAutomaticallyEnabledFeatures(metadata, current))
.normalized();

if (!required.canUpgradeTo(current)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

wouldn't we want to see if the currProtocol can be upgraded to the requiredProtocol ?

Copy link
Collaborator

@anoopj anoopj left a comment

Choose a reason for hiding this comment

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

LGTM

(1, 2),
(1, 3),
(1, 4),
(2, 5),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we want to test the full cross product here?

e.g. all possible reader versions X all possible writer versions?

e.g. writer version 5 and reader version 1? Is that possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants