dawidwys commented on PR #3771:
URL: https://github.com/apache/calcite/pull/3771#issuecomment-2079829317
> What does this do when you try to return a value which has an incorrect
type, e.g., you return an integer, but the value is an array? That is the kind
of negative test I have in mind.
I see. When you're a bit more descriptive it makes it much easier to address
your comments. It should behave the same way as `JSON_VALUE` does. Could you
point me to tests that check that behaviour of `JSON_VALUE`? I'll adapt those.
If you can't I'll try to write some myself once I am back from my vacation, but
I'd really appreciate pointers to existing tests.
> You can test your commits before submitting with ./gradlew build
Sorry about that, `./gradlew build` fails even on clean master locally for
me so it is hard for me to rely on it, but you're right it would've caught the
line that was too long.
```
FAILURE 6.6sec, 22 completed, 1 failed, 3 skipped,
org.apache.calcite.adapter.os.OsAdapterTest
7.0sec, org.apache.calcite.chinook.EndToEndTest > test(String)[1],
[1] sql/preferred-for-specific-user.iq
8.8sec, 4 completed, 0 failed, 0 skipped,
org.apache.calcite.chinook.EndToEndTest > test(String)
8.8sec, 4 completed, 0 failed, 0 skipped,
org.apache.calcite.chinook.EndToEndTest
```
Btw, as a side not. I've not written it before, because I found it unrelated
to this PR, but I find this issue:
https://issues.apache.org/jira/browse/CALCITE-6208 a bit useless. You can't
really return an `ARRAY` from a `JSON_VALUE`, because it can only produce
scalar values (which is in line with SQL standard). See
`JsonFunctions#jsonValue` and e.g.
https://github.com/apache/calcite/blob/5e837d02d0ba9e0b1e548acb5c218616234936c8/core/src/main/java/org/apache/calcite/runtime/JsonFunctions.java#L292
or
https://github.com/apache/calcite/blob/5e837d02d0ba9e0b1e548acb5c218616234936c8/core/src/main/java/org/apache/calcite/runtime/JsonFunctions.java#L278
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]