You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "sunchao (via GitHub)" <gi...@apache.org> on 2023/03/17 17:02:32 UTC

[GitHub] [arrow] sunchao opened a new pull request, #34611: GH-34610: [Java] Fix valueCount when loading NullVector

sunchao opened a new pull request, #34611:
URL: https://github.com/apache/arrow/pull/34611

   We should set `valueCount` and `nullCount` when loading `NullVector`.
   
   
   <!--
   Thanks for opening a pull request!
   If this is your first pull request you can find detailed information on how 
   to contribute here:
     * [New Contributor's Guide](https://arrow.apache.org/docs/dev/developers/guide/step_by_step/pr_lifecycle.html#reviews-and-merge-of-the-pull-request)
     * [Contributing Overview](https://arrow.apache.org/docs/dev/developers/overview.html)
   
   
   If this is not a [minor PR](https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
   
   Opening GitHub issues ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
   
   Then could you also rename the pull request title in the following format?
   
       GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
   
   or
   
       MINOR: [${COMPONENT}] ${SUMMARY}
   
   In the case of PARQUET issues on JIRA the title also supports:
   
       PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
   
   -->
   
   ### Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   When importing a `NullVector`, for example, via Arrow C interface, the `valueCount` and `nullCount` is currently not set properly, which will result both values to be 0.
   
   ### What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   Set `valueCount` when loading the vector.
   
   ### Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   Added a test. Also had to add extra constructor to facilitate the test.
   
   ### Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   No.
   
   <!--
   If there are any breaking changes to public APIs, please uncomment the line below and explain which changes are breaking.
   -->
   <!-- **This PR includes breaking changes to public APIs.** -->
   
   <!--
   Please uncomment the line below (and provide explanation) if the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld). We use this to highlight fixes to issues that may affect users without their knowledge. For this reason, fixing bugs that cause errors don't count, since those are usually obvious.
   -->
   <!-- **This PR contains a "Critical Fix".** -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-34610: [Java] Fix valueCount when loading NullVector [arrow]

Posted by "danepitkin (via GitHub)" <gi...@apache.org>.
danepitkin closed pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector
URL: https://github.com/apache/arrow/pull/34611


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1474136862

   * Closes: #34610


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] lidavidm commented on pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1474195186

   The JNI pipeline failure does seem related, though


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] sunchao commented on pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "sunchao (via GitHub)" <gi...@apache.org>.
sunchao commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1546089581

   Sorry @amol- and @danepitkin , we found a workaround to this issue internally so I haven't got a chance to re-visit the test failure. It's indeed weird and I plan to reproduce it locally and see what happened.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] amol- commented on pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "amol- (via GitHub)" <gi...@apache.org>.
amol- commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1507167186

   @sunchao are you still planning to take a look at the failing test? The PR has been inactive for the past month, it would be nice to lead it to merge if we have the chance to.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-34610: [Java] Fix valueCount when loading NullVector [arrow]

Posted by "danepitkin (via GitHub)" <gi...@apache.org>.
danepitkin commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1831126994

   I've followed this PR up here: https://github.com/apache/arrow/pull/38973
   
   The issue was in NullVector.getTransferPair(). It was not passing the name when transferring, which resulted in this check failing when comparing field names: https://github.com/apache/arrow/blob/61a4a803779db17a6c7bd57210e0dc92a067f2a0/java/vector/src/main/java/org/apache/arrow/vector/compare/TypeEqualsVisitor.java#L134
   
   I created a new PR since I didn't have permissions to push to your branch. I hope you don't mind!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] danepitkin commented on a diff in pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "danepitkin (via GitHub)" <gi...@apache.org>.
danepitkin commented on code in PR #34611:
URL: https://github.com/apache/arrow/pull/34611#discussion_r1192650781


##########
java/c/src/test/java/org/apache/arrow/c/RoundtripTest.java:
##########
@@ -462,6 +462,13 @@ public void testUInt8Vector() {
     }
   }
 
+  @Test
+  public void testNullVector() {
+    try (final NullVector vector = new NullVector("v", 1024)) {
+      assertTrue(roundtrip(vector, NullVector.class));

Review Comment:
   Hmm, its not obvious to me why this test is failing. I would've expected your change to `loadFieldBuffers()` to work. Maybe the field comparison is failing? I think you could try passing a custom `TypeEqualsVisitor` with `checkName` or `checkMetadata` disabled to narrow things down on line 155.
   
   ```
   return VectorEqualsVisitor.vectorEquals(vector, imported, <custom_visitor_here>);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] viirya commented on pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1474170949

   ```
   Error:  Errors: 
   Error:    TestBasicOperation.getStreamLargeBatch:273->test:315->test:333 � IllegalState Memory was leaked by query. Memory leaked: (134217728)
   Allocator(ROOT) 0/134217728/270532608/9223372036854775807 (res/actual/peak/limit)
   ```
   
   Hmm, is this related?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] sunchao commented on pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "sunchao (via GitHub)" <gi...@apache.org>.
sunchao commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1474199899

   Hmm thanks, let me take a look.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] viirya commented on pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1474196876

   yea, that's the added test `testNullVector`.
   
   ```
   Error:  org.apache.arrow.c.RoundtripTest.testNullVector  Time elapsed: 0.008 s  <<< FAILURE!
   org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] danepitkin commented on pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "danepitkin (via GitHub)" <gi...@apache.org>.
danepitkin commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1546103090

   > Sorry @amol- and @danepitkin , we found a workaround to this issue internally so I haven't got a chance to re-visit the test failure. It's indeed weird and I plan to reproduce it locally and see what happened.
   
   No worries! I noticed the Java implementation has been a bit quiet in general, so its great to see new fixes coming in.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] amol- commented on pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "amol- (via GitHub)" <gi...@apache.org>.
amol- commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1490669418

   Closing because it has been untouched for a while, in case it's still relevant feel free to reopen and move it forward 👍


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] amol- closed pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "amol- (via GitHub)" <gi...@apache.org>.
amol- closed pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector
URL: https://github.com/apache/arrow/pull/34611


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] github-actions[bot] commented on pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1474136924

   :warning: GitHub issue #34610 **has been automatically assigned in GitHub** to PR creator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] lidavidm commented on pull request #34611: GH-34610: [Java] Fix valueCount when loading NullVector

Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #34611:
URL: https://github.com/apache/arrow/pull/34611#issuecomment-1474171626

   No, there is a long standing issue for it that nobody has had time to look at.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org