To take advantage of Smart Acceleration, Eager Aggregation, and other performance enhancements native to Arcadia Engine, you must create analytical views.
This article describes how to create partition-based analytical views. For sequence-based analytical views, see CREATE ANALYTICAL VIEW; Sequence-Based.
The CREATE ANALYTICAL VIEW
command has the following syntax.
This topic contains the following sections:
CREATE ANALYTICAL VIEW [if not exists] database_name.analytical_view_name
[COMMENT table_comment]
[PARTITIONED BY (column_name, ... )]
STORED AS PARQUET
[LOCATION location]
AS select_statement;
The actual statement that describes the structure of the analytical view:
SELECT columns FROM table [WHERE conditions] [GROUP BY g_columns] [ORDER BY o_columns ASC|DESC]
PARTITIONED BY
columns must be the final columns in the
SELECT
list.AS select_statement
mandatory clause defines the structure of the
analytical view.Here is an example usage of create analytical view
. Note the select(...)
statement becomes associated with the analytical view.
CREATE ANALYTICAL VIEW events_aview
STORED AS PARQUET
AS (SELECT count(*), platform, sdk_version
FROM events
GROUP BY platform, sdk_version);