-
Notifications
You must be signed in to change notification settings - Fork 409
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
Add array index number to output when casting from json to array. #7397
Conversation
Adding |
Why is that necessary? |
In |
Yeah, adding it to multiplicity and cardinality checks is the correct thing
…On Thu, May 30, 2024, 07:21 dnwpark ***@***.***> wrote:
In _compile_call_args there is a check to ensure that all args have a
known multiplicity. The multiplicity is added in fini_expression. I
suppose the other alternative is to add an override to infer_multiplicity
on TypeCast.
—
Reply to this email directly, view it on GitHub
<#7397 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACTC7NSVWCINFOACRD3RTDZE4YUZAVCNFSM6AAAAABIIIVZQ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZZGY3DSMBZGI>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
06e32b7
to
7377855
Compare
Benchmarking against three queries: Simple null - 10000 times client.query(
"SELECT <array<int64>>to_json(<str>$input)",
input='[null]'
)
Long array - 1000 times client.query(
"SELECT <array<int64>>to_json(<str>$input)",
input='['+','.join(str(i) for i in range(1000))+',null'+']'
)
Long and deep array - 1000 times client.query(
"SELECT <array<tuple<array<tuple<array<int64>>>>>>to_json(<str>$input)",
input='['+','.join('[[[[1,2,3],[4,5,6],[7,8,9]]]]' for i in range(1000))+',[[[[1,2,null]]]]'+']'
)
|
@msullivan non-trivial cases seem convincingly much slower. |
Great work experimenting with this, though! |
Also, we support |
Given the query
SELECT <array<int64>>to_json('[1, 2, "asdf"]')
, produces the error: