You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/05 20:03:14 UTC

[GitHub] [arrow] lwhite1 commented on pull request #14289: ARROW-17585: [Java] Update GenerateSampleData.java

lwhite1 commented on PR #14289:
URL: https://github.com/apache/arrow/pull/14289#issuecomment-1265376017

   I don't think the rest of the values generated by this class tests corner
   cases. It's just filler data.
   
   On Mon, Oct 3, 2022 at 8:32 AM David Li ***@***.***> wrote:
   
   > ***@***.**** commented on this pull request.
   > ------------------------------
   >
   > In
   > java/vector/src/main/java/org/apache/arrow/vector/GenerateSampleData.java
   > <https://github.com/apache/arrow/pull/14289#discussion_r985728969>:
   >
   > > +  private static void writeUInt4Data(UInt4Vector vector, int valueCount) {
   > +    final int even = 1000;
   > +    final int odd = 2000;
   > +    for (int i = 0; i < valueCount; i++) {
   > +      if (i % 2 == 0) {
   > +        vector.setSafe(i, even);
   > +      } else {
   > +        vector.setSafe(i, odd);
   > +      }
   > +    }
   > +    vector.setValueCount(valueCount);
   > +  }
   > +
   > +  private static void writeUInt8Data(UInt8Vector vector, int valueCount) {
   > +    final long even = 1000000000;
   > +    final long odd = 2000000000;
   >
   > Well, the value has to be representable somehow (else how would IPC work?
   > I'm guessing you'd just take a negative int and it would reinterpret it as
   > an unsigned integer) and I'd want us to test a range of values that may
   > occur (the C++ unit tests for kernels, for instance, try to test the
   > extremes, 0, negatives, etc. to catch corner cases, and frameworks like
   > Hypothesis generalize this)
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/arrow/pull/14289#discussion_r985728969>, or
   > unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AA2FPAQHLBYLHT2VJO6HWDLWBLG7DANCNFSM6AAAAAAQ2QPYBM>
   > .
   > You are receiving this because you authored the thread.Message ID:
   > ***@***.***>
   >
   


-- 
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