samuelcolvin commented on issue #10180:
URL: https://github.com/apache/datafusion/issues/10180#issuecomment-2072538449
@jayzhan211 that doesn't work since the argument types don't tell you want
type will be returned.
e.g.:
* if the value in column `foo` is `{"x": "abc"}`, then `json_get(foo, 'x')`
will return a string
* but if the value in column `foo` is `{"x": 123}`, then `json_get(foo,
'x')` will return an integer
However I think I have a work around, I'm requiring a cast, so you have to
do `json_get(foo, 'x')::string` or `json_get(foo, 'x')::int`, then I'm using a
`FunctionRewrite` to rewrite the function from `json_get` to `json_get_str` or
`json_get_int`.
With that the only remaining issue is making the error less ugly and more
informative.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]