Skip to content

Commit

Permalink
Update Java string concatenate test for single column (#8330)
Browse files Browse the repository at this point in the history
to stringConcatenate when using a scalar separator.

Reference #8282 changed to throw an exception if only a single column is passed in to the stringConcatenate using scalar separator.  Update our Java test for that functionality.

Signed-off-by: Thomas Graves <[email protected]>

Authors:
  - Thomas Graves (https://github.com/tgravescs)

Approvers:
  - Robert (Bobby) Evans (https://github.com/revans2)
  - Jason Lowe (https://github.com/jlowe)

URL: #8330
  • Loading branch information
tgravescs authored May 24, 2021
1 parent e555643 commit b1d7788
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions java/src/test/java/ai/rapids/cudf/ColumnVectorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2099,15 +2099,16 @@ void testStringConcatWithNulls() {
assertColumnsAreEqual(concat, e_concat);
}

try (ColumnVector v = ColumnVector.fromStrings("a", "B", "cd", "\u0480\u0481", "E\tf",
"g\nH", "IJ\"\u0100\u0101\u0500\u0501",
"kl m", "Nop1", "\\qRs2", null,
"3tuV\'", "wX4Yz", "\ud720\ud721");
Scalar emptyString = Scalar.fromString("");
Scalar nullSubstitute = Scalar.fromString("NULL");
ColumnVector concat = ColumnVector.stringConcatenate(emptyString, nullSubstitute, new ColumnView[]{v})) {
assertColumnsAreEqual(v, concat);
}
assertThrows(CudfException.class, () -> {
try (ColumnVector v = ColumnVector.fromStrings("a", "B", "cd", "\u0480\u0481", "E\tf",
"g\nH", "IJ\"\u0100\u0101\u0500\u0501",
"kl m", "Nop1", "\\qRs2", null,
"3tuV\'", "wX4Yz", "\ud720\ud721");
Scalar emptyString = Scalar.fromString("");
Scalar nullSubstitute = Scalar.fromString("NULL");
ColumnVector concat = ColumnVector.stringConcatenate(emptyString, nullSubstitute, new ColumnView[]{v})) {
}
});
}

@Test
Expand Down

0 comments on commit b1d7788

Please sign in to comment.