-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
MINOR: Make ColumnPath immutable #1380
MINOR: Make ColumnPath immutable #1380
Conversation
not yet. I will create one if needed |
@@ -83,6 +83,6 @@ public int size() { | |||
} | |||
|
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 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.
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 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?
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.
ya, i think that new method will help
02fc946
to
3b82f09
Compare
@@ -83,6 +83,6 @@ public int size() { | |||
} | |||
|
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.
ya, i think that new method will help
It seems that you need to run |
Similar to `ColumnPath.toArray`, but avoids copying the path.
3b82f09
to
195cee8
Compare
@wgtmac thanks! can you please allow the workflow again? It passed on my fork this time. |
BTW, could you please create an issue to explain why do we need this change? https://github.com/apache/parquet-java/issues/new/choose |
I don't think i can describe my reasoning in terms of a end-user perceivable bug. I do believe immutable objects are easier to reason about and ColumnPath looks like it was intended not to be mutated. |
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.
+1
Thanks @findepi and @raunaqmorarka!
Make sure you have checked all steps below.
Jira
them in the PR title. For example, "PARQUET-1234: My Parquet PR"
the ASF 3rd Party License Policy.
Tests
Commits
from "How to write a good git commit message":
Style
mvn spotless:apply -Pvector-plugins
Documentation