Skip to content
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 json_serialize_plan, json_serialize_sql tweaks #9230

Merged
merged 4 commits into from Oct 16, 2023

Conversation

Maxxen
Copy link
Member

@Maxxen Maxxen commented Oct 5, 2023

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 takes skip_empty := bool, skip_null := bool, format := bool optional arguments to control the json output, as well as an additional optimize := bool argument specifying whether or not to serialize after or before plan optimization (default false, without optimizing).

Future work:

  • Implement de/serialization support for the last couple of unsupported operators
  • Implement a way to execute the produced json serialized plans, similar to the 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.

@github-actions github-actions bot marked this pull request as draft October 5, 2023 14:14
@Maxxen Maxxen marked this pull request as ready for review October 5, 2023 14:14
@github-actions github-actions bot marked this pull request as draft October 5, 2023 15:44
@Maxxen Maxxen marked this pull request as ready for review October 5, 2023 17:11
@Maxxen
Copy link
Member Author

Maxxen commented Oct 5, 2023

Great, the temp catalog name differs when running with --force-storage

@github-actions github-actions bot marked this pull request as draft October 5, 2023 22:05
@Maxxen Maxxen marked this pull request as ready for review October 5, 2023 22:07
@Mytherin Mytherin changed the base branch from main to feature October 6, 2023 09:26
@Maxxen Maxxen requested a review from Mytherin October 9, 2023 07:50
@Mytherin Mytherin merged commit 0fe1b77 into duckdb:feature Oct 16, 2023
49 checks passed
@Mytherin
Copy link
Collaborator

Thanks!

krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Dec 11, 2023
Merge pull request duckdb/duckdb#9164 from Mause/feature/jdbc-uuid-param
Merge pull request duckdb/duckdb#9185 from pdet/adbc_07
Merge pull request duckdb/duckdb#9126 from Maxxen/parquet-kv-metadata
Merge pull request duckdb/duckdb#9123 from lnkuiper/parquet_schema
Merge pull request duckdb/duckdb#9086 from lnkuiper/json_inconsistent_structure
Merge pull request duckdb/duckdb#8977 from Tishj/python_readcsv_multi_v2
Merge pull request duckdb/duckdb#9279 from hawkfish/nsdate-cast
Merge pull request duckdb/duckdb#8851 from taniabogatsch/binary_lambdas
Merge pull request duckdb/duckdb#8983 from Maxxen/types/fixedsizelist
Merge pull request duckdb/duckdb#9318 from Maxxen/fix-unused
Merge pull request duckdb/duckdb#9220 from hawkfish/exclude
Merge pull request duckdb/duckdb#9230 from Maxxen/json-plan-serialization
Merge pull request duckdb/duckdb#9011 from Tmonster/add_create_statement_support_to_fuzzer
Merge pull request duckdb/duckdb#9400 from Maxxen/array-fixes
Merge pull request duckdb/duckdb#8741 from Tishj/python_import_cache_upgrade
Merge fixes
Merge pull request duckdb/duckdb#9395 from taniabogatsch/lambda-performance
Merge pull request duckdb/duckdb#9427 from Tishj/python_table_support_replacement_scan
Merge pull request duckdb/duckdb#9516 from carlopi/fixformat
Merge pull request duckdb/duckdb#9485 from Maxxen/fix-parquet-serialization
Merge pull request duckdb/duckdb#9388 from chrisiou/issue217
Merge pull request duckdb/duckdb#9565 from Maxxen/fix-array-vector-sizes
Merge pull request duckdb/duckdb#9583 from carlopi/feature
Merge pull request duckdb/duckdb#8907 from cryoEncryp/new-list-functions
Merge pull request duckdb/duckdb#8642 from Virgiel/capi-streaming-arrow
Merge pull request duckdb/duckdb#8658 from Tishj/pytype_optional
Merge pull request duckdb/duckdb#9040 from Light-City/feature/set_mg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants