Ji Liu created ARROW-5726:
-----------------------------
Summary: [Java] Implement a common interface for int vectors
Key: ARROW-5726
URL: https://issues.apache.org/jira/browse/ARROW-5726
Project: Apache Arrow
Issue Type: New Feature
Components: Java
Reporter: Ji Liu
Assignee: Ji Liu
Now in _DictionaryEncoder#encode_ it use reflection to pull out the set method
and then set values.
Set values by reflection is not efficient and code structure is not elegant
such as
_Method setter = null;_
_for (Class<?> c : Arrays.asList(int.class, long.class)) {_
_try {_
_setter = indices.getClass().getMethod("setSafe", int.class, c);_
_break;_
_} catch (NoSuchMethodException e) {_
_// ignore_
_}_
_}_
Implement a common interface for int vectors to directly get set method and set
values seems a good choice.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)