Skip to main content

show_parsed_schemas(query)

The show_parsed_schema function is designed to provide a structured representation of the schema. This function is particularly useful in Structured Data Extraction after you have extracted layout from the document to understand the schema output of a sub-query or a complex SQL statement without executing it against the actual database.

Syntax

SELECT * FROM show_parsed_schemas(query);

Usage Example

Following the example in extract_layout

CREATE TABLE pdf_blocks_billionaires
ENGINE = Memory AS
SELECT * FROM extract_layout(
(select * from load (
'https://en.wikipedia.org/api/rest_v1/page/pdf/The_World%27s_Billionaires'
)), type=> 'PDF', page_range=> [2,3])

select * from show_parsed_schemas((select * from pdf_blocks_billionaires)) where schema<> ''

Output

| table_index | schema                                                                                                                     |
|-------------|----------------------------------------------------------------------------------------------------------------------------|
| 0 | `No.` String,`Age` String,`Primary source(s) of wealth` String,`Name` String,`Net worth (USD)` String,`Nationality` String |