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

vam: Array Expressions #5462

Merged
merged 2 commits into from
Nov 15, 2024
Merged

vam: Array Expressions #5462

merged 2 commits into from
Nov 15, 2024

Conversation

mattnibs
Copy link
Collaborator

@mattnibs mattnibs commented Nov 11, 2024

Add vector array expressions. When building an array in vector land you are often creating a non-union inner type that includes values from multiple vectors. This presents a problem because you cannot merge the vectors using a dynamic because dynamics are supposed to bubble up on be on top. As such I've added vector.Builder that is used to rebuild the multiple vectors to a single vector when this is encountered.

@philrz
Copy link
Contributor

philrz commented Nov 11, 2024

I happened to be revisiting the mgbench queries and since I get vector expression type *dag.ArrayExpr: not supported on the tip of main when trying to run bench1/q1 with vectors, I remembered this branch just went up. I now get:

$ super -version
Version: v1.18.0-139-ge69d3fd6

$ super dev vector query "where
     log_time >= 2017-01-11T00:00:00Z
     and machine_name in ['anansi','aragog','urd']" bench1.csup

invalid binary operator in

Not sure if that's expected to work here or would come later, but figured I'd report.

@mattnibs
Copy link
Collaborator Author

@philrz no support for in operator in this pr

Copy link
Member

@nwt nwt left a comment

Choose a reason for hiding this comment

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

Also change sequential array spreads so that spreads on non-array values yield the value itself.

What about docs? And record spreads on non-record values?

@mattnibs
Copy link
Collaborator Author

@nwt can we handle records in a separate pr?

@mattnibs
Copy link
Collaborator Author

Given there's some controversy over this I'm just going to get rid of spread on primitives for now

@mattnibs mattnibs force-pushed the vam-array-expr branch 2 times, most recently from 0b87a0b to 595e351 Compare November 13, 2024 02:58
@mattnibs mattnibs force-pushed the vam-array-expr branch 2 times, most recently from cf0faf8 to 1a6e89d Compare November 13, 2024 19:07
@mattnibs
Copy link
Collaborator Author

@nwt ready for another review I added back the behavior where non-spreadable elements are ignored.

@mattnibs mattnibs force-pushed the vam-array-expr branch 5 times, most recently from 2ab9b9d to 6b3a206 Compare November 13, 2024 19:12
@mattnibs mattnibs requested a review from nwt November 13, 2024 19:16
@mattnibs mattnibs force-pushed the vam-array-expr branch 2 times, most recently from 4ba0f49 to 58d5444 Compare November 13, 2024 19:30
compiler/kernel/vexpr.go Show resolved Hide resolved
compiler/kernel/vexpr.go Outdated Show resolved Hide resolved
runtime/vam/expr/arrayexpr.go Outdated Show resolved Hide resolved
@mattnibs mattnibs merged commit e85e38e into main Nov 15, 2024
3 checks passed
@mattnibs mattnibs deleted the vam-array-expr branch November 15, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants