[
https://issues.apache.org/jira/browse/ARROW-6472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16924014#comment-16924014
]
Ji Liu commented on ARROW-6472:
-------------------------------
cc [~pravindra] [~fan_li_ya] for comments on this issue, do you have any points
how to resolve this problem in your mind?
Here are some my initial thoughts:
I am against that visitors keep both leftVector and rightVector for some
reasons:
i. make visitor and accept API inconsistent as we mentioned before
ii. I think visitor should be reused for multiple leftVectors (with one
visitor, vector1.accept(visitor, IN), vector2.accept(visitor, IN) …), and this
way, the left and right vectors are fixed.
If we remove leftVector and pass it in via accept API, the main problem we
should solve is repeated type checks in ListVector, we could do something to
avoid this:
i. Keep Range param since it makes it possible for compare different ranges
without creating extra visitor instance.
ii. Move typeCheck flag into Range(default is true), in cases compare
ListVector data vector, change the flag after first compare and we could skip
type checks in follow-up compares according to this flag.
This is only an initial thoughts and would be better if you have other points.
If we could not find a proper solution or reach a consistent in this JIRA, it‘s
ok for me to start a discuss in ML.
Thanks!
> [Java] ValueVector#accept may has potential cast exception
> ----------------------------------------------------------
>
> Key: ARROW-6472
> URL: https://issues.apache.org/jira/browse/ARROW-6472
> Project: Apache Arrow
> Issue Type: Bug
> Components: Java
> Reporter: Ji Liu
> Assignee: Ji Liu
> Priority: Major
>
> Per discussion
> [https://github.com/apache/arrow/pull/5195#issuecomment-528425302]
> We may use API this way:
> {code:java}
> RangeEqualsVisitor visitor = new RangeEqualsVisitor(vector1, vector2);
> vector3.accept(visitor, range){code}
> if vector1/vector2 are say, {{StructVector}}s and vector3 is an {{IntVector}}
> - things can go bad. we'll use the {{compareBaseFixedWidthVectors()}} and do
> wrong type-casts for vector1/vector2.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)