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

Make ColumnPath immutable #1380

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

Conversation

findepi
Copy link
Contributor

@findepi findepi commented Jun 20, 2024

Make sure you have checked all steps below.

Jira

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason: I don't know of an estabilished way of testing for class immutability

Commits

  • My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines
    from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Style

  • My contribution adheres to the code style guidelines and Spotless passes.
    • To apply the necessary changes, run mvn spotless:apply -Pvector-plugins

Documentation

  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain Javadoc that explain what it does

@findepi
Copy link
Contributor Author

findepi commented Jun 20, 2024

cc @raunaqmorarka

  • My PR addresses the following Parquet Jira issues and references
    them in the PR title.

not yet. I will create one if needed

@@ -83,6 +83,6 @@ public int size() {
}

Copy link

@raunaqmorarka raunaqmorarka Jun 21, 2024

Choose a reason for hiding this comment

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

I think it would also help to have a boolean equals(String[] path) method so that we can make path equality checks without incurring an unnecessary array copy.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know it could be useful for Parquet users such as Trino, but was hesitant to add this as not directly related to immutability. Since toArray became copying, i added toList which avoids copy. Maybe this new method also satisfies those needs and we don't need yet another one?

Choose a reason for hiding this comment

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

ya, i think that new method will help

@findepi findepi force-pushed the findepi/make-columnpath-immutable-b03814 branch 2 times, most recently from 4e5bc8c to 02fc946 Compare June 22, 2024 10:08
Similar to `ColumnPath.toArray`, but avoids copying the path.
@findepi findepi force-pushed the findepi/make-columnpath-immutable-b03814 branch from 02fc946 to 3b82f09 Compare June 22, 2024 10:14
@@ -83,6 +83,6 @@ public int size() {
}

Choose a reason for hiding this comment

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

ya, i think that new method will help

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.

None yet

2 participants