Repository navigation
Add parse_json and format_json conversions - #11693
connortsui20 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Should this be split into 2 separate scalar functions?
4f56b1e to
489ae9f
Compare
Merging this PR will not alter performance2 warnings
Comparing Footnotes
|
A conversion that changes what a value means belongs to the type, not to the generic cast, so the JSON crate registers named functions that convert Utf8 to Json and back. Both validate each value as one JSON document and keep its original text. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
262343a to
a41646f
Compare
There was a problem hiding this comment.
This is what the robots generated, is this the correct way to do things?
Vortex has no way to turn
Utf8text into aJsonvalue, andext_storagereturns the text of aJsonvalue without checking it. A conversion that changes what a value means belongs to the type and not to the generic cast (#11599), so the JSON crate registersparse_jsonandformat_jsonas named functions.Both directions check that each value is one complete JSON document and keep its original text, so number notation, key order, and whitespace survive a round trip. Formatting checks too, because arrays don't check extension values when they are built yet (#11601), so a stored value that isn't valid JSON returns an error instead of text.
The options schema lives in a new
vortex-json/proto/json.protoand not next toJsonToVariantOptsinvortex-array, because a schema belongs to the crate that owns the function.Like other functions that can fail, both can fail on a
RunEndrun that no row references, becauseRunEndpushes a function into all of its values. #11690 fixes this for every function.Prepared with AI assistance.