Skip to content
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

ARROW-6080: [Java] Support search operation for BaseRepeatedValueVector #4974

Closed
wants to merge 1 commit into from

Conversation

liyafan82
Copy link
Contributor

Support comparison & search for sub-classes of BaseRepeatedValueVector.

@@ -230,6 +235,50 @@ public int compareNotNull(int index1, int index2) {
}
}

/**
* Default comparator for {@link BaseRepeatedValueVector}.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you document how it compares elements?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion. Thanks.

Copy link
Contributor

@emkornfield emkornfield left a comment

Choose a reason for hiding this comment

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

small documentation comment otherwise, looks reasonable to me.

@codecov-io
Copy link

codecov-io commented Aug 11, 2019

Codecov Report

Merging #4974 into master will decrease coverage by 0.35%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4974      +/-   ##
==========================================
- Coverage   87.64%   87.28%   -0.36%     
==========================================
  Files        1014      714     -300     
  Lines      145922   107403   -38519     
  Branches     1437        0    -1437     
==========================================
- Hits       127887    93751   -34136     
+ Misses      17673    13652    -4021     
+ Partials      362        0     -362
Impacted Files Coverage Δ
cpp/src/arrow/util/cpu-info.h 0% <0%> (-50%) ⬇️
cpp/src/arrow/util/io-util.cc 69.13% <0%> (-7.1%) ⬇️
cpp/src/arrow/ipc/metadata-internal.cc 83.37% <0%> (-4.61%) ⬇️
cpp/src/arrow/csv/column-builder.cc 92.57% <0%> (-4.46%) ⬇️
cpp/src/arrow/ipc/reader.cc 85.31% <0%> (-3.96%) ⬇️
cpp/src/parquet/arrow/reader_internal.cc 88.23% <0%> (-3.51%) ⬇️
cpp/src/arrow/flight/serialization-internal.cc 88.65% <0%> (-2.84%) ⬇️
cpp/src/arrow/util/rle-encoding.h 98.22% <0%> (-1.43%) ⬇️
cpp/src/arrow/util/thread-pool.cc 95.77% <0%> (-1.41%) ⬇️
cpp/src/arrow/util/cpu-info.cc 73.68% <0%> (-1.32%) ⬇️
... and 390 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 2ba0566...63c7519. Read the comment docs.

@@ -190,4 +196,105 @@ public void testLinearSearchVarChar() {
assertEquals(-1, VectorSearcher.linearSearch(rawVector, comparator, negVector, 0));
}
}

private ListVector createListVector() {
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, taking a look at these unit tests, I'm not sure they provide good coverage. I think it would be better to have tests against the comparator directly. For:

  1. First N elements equal, with one vector longer then the other.
  2. N elements equal, and the N + 1 unequal
  3. Equal vectors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem. We appreciate your careful review.
Tests added as you suggested.

@emkornfield
Copy link
Contributor

@liyafan82 thanks for additional tests. Looks good just trying to rerun the failing CI job before merging.

@liyafan82
Copy link
Contributor Author

@liyafan82 thanks for additional tests. Looks good just trying to rerun the failing CI job before merging.

@emkornfield thank you for your effort.

@emkornfield
Copy link
Contributor

+1, thank you.

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.

None yet

4 participants