-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add Java/JNI applyNullMask to ColumnView #23983
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| /* | ||
| * | ||
| * SPDX-FileCopyrightText: Copyright (c) 2020, NVIDIA CORPORATION. | ||
| * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| */ | ||
|
|
@@ -1167,4 +1167,39 @@ void testMismatchedTypesSS() { | |
| assertThrows(CudfException.class, () -> pred.ifElse(trueScalar, falseScalar)); | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| void testApplyNullMask() { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win Add a unit benchmark for This PR adds unit tests, but it does not add the required unit benchmark for the new GPU copy-and-mask operation. Benchmark representative fixed-width and nested columns. As per coding guidelines, “6. Add unit tests and unit benchmarks.” 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| try (ColumnVector input = ColumnVector.fromBoxedInts(0, 100, 1, 2, Integer.MIN_VALUE, null); | ||
| ColumnVector mask = ColumnVector.fromBoxedBooleans(true, false, true, null, false, true); | ||
| ColumnVector result = input.applyNullMask(mask); | ||
| ColumnVector expected = ColumnVector.fromBoxedInts(0, null, 1, null, null, null)) { | ||
| assertColumnsAreEqual(expected, result); | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| void testApplyNullMaskAllTrueIsValuePreserving() { | ||
| try (ColumnVector input = ColumnVector.fromBoxedInts(0, 100, null, 2); | ||
| ColumnVector mask = ColumnVector.fromBoxedBooleans(true, true, true, true); | ||
| ColumnVector result = input.applyNullMask(mask)) { | ||
| assertColumnsAreEqual(input, result); | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| void testApplyNullMaskRejectsNonBooleanMask() { | ||
| try (ColumnVector input = ColumnVector.fromBoxedInts(0, 100, 1, 2); | ||
| ColumnVector mask = ColumnVector.fromBoxedInts(1, 0, 1, 0)) { | ||
| assertThrows(IllegalArgumentException.class, () -> input.applyNullMask(mask)); | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| void testApplyNullMaskRejectsRowCountMismatch() { | ||
| try (ColumnVector input = ColumnVector.fromBoxedInts(0, 100, 1, 2); | ||
| ColumnVector mask = ColumnVector.fromBoxedBooleans(true, false, true)) { | ||
| assertThrows(IllegalArgumentException.class, () -> input.applyNullMask(mask)); | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.