v.24.9Experimental Feature
Add aggregate functions for JSON column introspection
Add aggregate functionsdistinctDynamicTypes/distinctJSONPaths/distinctJSONPathsAndTypesfor better introspection of JSON column type content. #68463 (Kruglov Pavel).
Why it matters
These functions provide users with better tools to analyze and understand the structure and variety of data types and paths within JSON columns. This helps in identifying dynamic types and paths present across JSON data, improving schema discovery and data quality assessment.How to use it
Use the new aggregate functionsdistinctDynamicTypes, distinctJSONPaths, and distinctJSONPathsAndTypes within your SELECT queries on JSON columns to introspect their content. For example:SELECT distinctDynamicTypes(json_column) FROM table;
SELECT distinctJSONPaths(json_column) FROM table;
SELECT distinctJSONPathsAndTypes(json_column) FROM table;