Skip to content
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

stop using copyWithBooleanColumnAsValidity #11399

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ object GpuOrcScan {
}
// Replace values that cause overflow with nulls, same with CPU ORC.
withResource(overflowFlags) { _ =>
casted.copyWithBooleanColumnAsValidity(overflowFlags)
// This is an integer type so we don't have to worry about
// nested DTypes here.
withResource(Scalar.fromNull(toType)) { NULL =>
overflowFlags.ifElse(casted, NULL)
}
}
}
}
Expand Down Expand Up @@ -334,7 +338,9 @@ object GpuOrcScan {
// next convert to long,
// then down cast long to the target integral type.
val longDoubles = withResource(doubleCanFitInLong(col)) { fitLongs =>
col.copyWithBooleanColumnAsValidity(fitLongs)
withResource(Scalar.fromNull(fromDt)) { NULL =>
fitLongs.ifElse(col, NULL)
}
}
withResource(longDoubles) { _ =>
withResource(longDoubles.castTo(DType.INT64)) { longs =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2023, NVIDIA CORPORATION.
* Copyright (c) 2020-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -297,8 +297,10 @@ case class GpuArrayContains(left: Expression, right: Expression)
val containsKeyOrNotContainsNull = withResource(notContainsNull) {
containsResult.or(_)
}
withResource(containsKeyOrNotContainsNull) {
containsResult.copyWithBooleanColumnAsValidity(_)
withResource(containsKeyOrNotContainsNull) { lcnn =>
withResource(Scalar.fromNull(DType.BOOL8)) { NULL =>
lcnn.ifElse(containsResult, NULL)
}
}
}

Expand Down