Add json_serialize_plan
, json_serialize_sql tweaks
#9230
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new
json_serialize_plan(VARCHAR)
scalar function to serialize a sequence of semicolon-separated sql statements into a json containing a list of each statements query plan, in json format. This is now possible for most* operators due to the recent serialization overhaul.Like the
json_serialize_sql
function, this also takesskip_empty := bool
,skip_null := bool
,format := bool
optional arguments to control the json output, as well as an additionaloptimize := bool
argument specifying whether or not to serialize after or before plan optimization (default false, without optimizing).Future work:
json_execute_serialized_sql
table function. This is more complicated since the plans are already bound after deserialization and some plans don't produce any values as results (e.g. insert), but we still need to bind some column return types/names if we go the table function route.