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

feat: Support array_intersect(Unknown) #12448

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xiaodouchen
Copy link
Contributor

No description provided.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 26, 2025
Copy link

netlify bot commented Feb 26, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 0d16e01
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/67be85c223f4f700086db1aa

@xiaodouchen
Copy link
Contributor Author

@kewang1024 @kevinwilfong @mbasmanova Could you please review it, thanks.

Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiaodouchen Would this function run into same / similar limitation in Fuzzer as array_join?

CC: @kgpai @kagamiori

@@ -622,7 +622,10 @@ std::shared_ptr<exec::VectorFunction> createTypedArraysIntersectExcept(
VELOX_CHECK_EQ(inputArgs.size(), 2);
const BaseVector* rhs = inputArgs[1].constantValue.get();

if (elementType->providesCustomComparison()) {
if constexpr (kind == TypeKind::UNKNOWN) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UNKNOWN values can only be nulls. Intersecting arrays of NULLs can be done faster by looking at just the array sizes, no?

This change affects array_except function as well? If so, can we add test coverage?

@@ -735,3 +735,50 @@ TEST_F(ArrayIntersectTest, nullInDictionary) {
makeNullableArrayVector<int64_t>({{{1}}, std::nullopt, {{7}}});
testExpr(expected, "array_intersect(c0)", {arrays});
}

TEST_F(ArrayIntersectTest, unknownArrays) {
auto array1 = makeNullableArrayVector<UnknownValue>(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit hard to read. Is there a way to extend makeArrayVectorFromJson to work with Unknown?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants