Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17184#discussion_r104626620
  
    --- Diff: 
common/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java 
---
    @@ -608,4 +609,55 @@ public void writeToOutputStreamIntArray() throws 
IOException {
             .writeTo(outputStream);
         assertEquals("大千世界", outputStream.toString("UTF-8"));
       }
    +
    +  @Test
    +  public void testIsIntMaybe() throws IOException {
    +    assertEquals(true, UTF8String.fromString("1").isIntMaybe());
    +    assertEquals(true, UTF8String.fromString("+1").isIntMaybe());
    +    assertEquals(true, UTF8String.fromString("-1").isIntMaybe());
    +    assertEquals(true, UTF8String.fromString("0").isIntMaybe());
    +    assertEquals(true, 
UTF8String.fromString(String.valueOf(Integer.MAX_VALUE)).isIntMaybe());
    +    assertEquals(true, UTF8String.fromString("+" + 
String.valueOf(Integer.MAX_VALUE)).isIntMaybe());
    +    assertEquals(true, 
UTF8String.fromString(String.valueOf(Integer.MIN_VALUE)).isIntMaybe());
    +
    +    Random rand = new Random();
    +    for(int i = 0; i < 10; i++) {
    --- End diff --
    
    Nit, which lint might catch: space after for.
    Seed the RNG for determinism?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to