20.2. Copying the OLAP Data to an Analytical Table From Other Tables #
Execute the following query:
SELECT metastore.copy_table('table_name', SQL_query);
Where:
table_name: The name of the analytical table to which the OLAP data is copied.SQL_query: The SQL query that determines which OLAP data is copied, for example,SELECT * FROM my_pgtable.The SQL query must be a single valid
SELECTstatement. TheUNIONoperation is not supported.
Example 20.2.
SELECT copy_table('table_example', $$select * from pg_table_example$$);
Once the query is executed, pgpro_metastore performs the following actions:
Verifies user privileges.
Creates a new entry in the
pga_snapshotmetadata table.Creates a directory for results of the SQL query that are saved as Parquet files.
Executes the SQL query and writes its results to Parquet files.