Skip to content

Conversation

@liyafan82
Copy link
Contributor

All types of variable-width vectors can reuse the same comparator for sorting & searching.

if (vector instanceof TinyIntVector) {
return (VectorValueComparator<T>) new ByteComparator();
} else if (vector instanceof SmallIntVector) {
return (VectorValueComparator<T>) new ShortComparator();
Copy link
Contributor

Choose a reason for hiding this comment

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

are the casts needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. It seems the Java compiler cannot infer the generic type based on the instance of operator.

@liyafan82 liyafan82 closed this Jul 19, 2019
@liyafan82 liyafan82 reopened this Jul 19, 2019
@codecov-io
Copy link

Codecov Report

Merging #4860 into master will increase coverage by 2.38%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4860      +/-   ##
==========================================
+ Coverage   87.42%    89.8%   +2.38%     
==========================================
  Files         994      661     -333     
  Lines      140102   100936   -39166     
  Branches     1418        0    -1418     
==========================================
- Hits       122481    90646   -31835     
+ Misses      17259    10290    -6969     
+ Partials      362        0     -362
Impacted Files Coverage Δ
cpp/src/arrow/array/builder_union.h 62.96% <0%> (-17.99%) ⬇️
cpp/src/arrow/array/builder_union.cc 76.19% <0%> (-16.12%) ⬇️
cpp/src/arrow/table.cc 93.66% <0%> (-2.81%) ⬇️
cpp/src/arrow/builder.cc 84.25% <0%> (-2.41%) ⬇️
python/pyarrow/tests/test_orc.py 95.45% <0%> (-1.52%) ⬇️
cpp/src/arrow/util/thread-pool-test.cc 97.66% <0%> (-0.94%) ⬇️
cpp/src/arrow/array.cc 80.23% <0%> (-0.51%) ⬇️
cpp/src/parquet/arrow/writer.cc 96.26% <0%> (-0.49%) ⬇️
cpp/src/arrow/ipc/json-simple.cc 97.94% <0%> (-0.44%) ⬇️
cpp/src/gandiva/precompiled/decimal_ops_test.cc 97.03% <0%> (-0.4%) ⬇️
... and 370 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c350bba...cbd8c3f. Read the comment docs.

@emkornfield
Copy link
Contributor

+1

kszucs pushed a commit that referenced this pull request Jul 22, 2019
All types of variable-width vectors can reuse the same comparator for sorting & searching.

Author: liyafan82 <fan_li_ya@foxmail.com>

Closes #4860 from liyafan82/fly_0712_varsort and squashes the following commits:

cbd8c3f <liyafan82>   Provide a utility to create the default comparator
46d2c11 <liyafan82>  Support sort & compare for all variable width vectors
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
All types of variable-width vectors can reuse the same comparator for sorting & searching.

Author: liyafan82 <fan_li_ya@foxmail.com>

Closes apache#4860 from liyafan82/fly_0712_varsort and squashes the following commits:

cbd8c3f <liyafan82>   Provide a utility to create the default comparator
46d2c11 <liyafan82>  Support sort & compare for all variable width vectors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants