ARROW-6021: [Java] Extract copyFrom and copyFromSafe methods to ValueVector interface#4931
ARROW-6021: [Java] Extract copyFrom and copyFromSafe methods to ValueVector interface#4931liyafan82 wants to merge 1 commit intoapache:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4931 +/- ##
==========================================
+ Coverage 87.5% 89.64% +2.13%
==========================================
Files 998 664 -334
Lines 142085 98021 -44064
Branches 1418 0 -1418
==========================================
- Hits 124336 87872 -36464
+ Misses 17387 10149 -7238
+ Partials 362 0 -362Continue to review full report at Codecov.
|
There was a problem hiding this comment.
there's already an impl of copyFrom in UnionVector, right ?
There was a problem hiding this comment.
things can go bad if the caller passes a fixed-width vector in the 'from'.
There was a problem hiding this comment.
Good question.
Things will go wrong is the source and target are of different vector types. Even if both are fixed-width vectors, things can go wrong (e.g. from a IntVector to a Float4Vector).
One solution is to check types each time, however, this may have performance penalty, as copyFrom is a frequently called operation. So current assumption is that the caller should make sure the source and target are of the same type.
There was a problem hiding this comment.
can we add something cheap, like checking the minorType ?
e17978b to
9cd2596
Compare
|
thanks for the change, @liyafan82 |
…Vector interface Currently we have copyFrom and copyFromSafe methods in fixed-width and variable-width vectors. Extracting them to the common super interface will make it much more convenient to use them, and avoid unnecessary if-else statements. Closes apache#4931 from liyafan82/fly_0724_copy and squashes the following commits: 1ce95bb <liyafan82> Extract copyFrom and copyFromSafe methods to ValueVector interface Authored-by: liyafan82 <fan_li_ya@foxmail.com> Signed-off-by: Pindikura Ravindra <ravindra@dremio.com>
Currently we have copyFrom and copyFromSafe methods in fixed-width and variable-width vectors. Extracting them to the common super interface will make it much more convenient to use them, and avoid unnecessary if-else statements.