In the Command Line Utility, you have an option to write the analytical view recommendations directly to a file.
This output format is similar to the recommendation-only
output mode, which
displays only the analytical view create statements and syntax of the input queries. This
format makes it easy for the admins to write a script that automatically reads the file and
creates corresponding analytical views.
To write the analytical view recommendations to a file, enter a command with the following syntax.
./arcviz util recommendation --dcname=<data_connection_name> --file=<file_path to the queries file>
--write=<file_path to the output file>
<aview create statement_1>
<aview create statement_2>
...
<aview create statement_n>
In our example, the queries are accessed from the text.txt file and output is saved
in the output.txt
file.
./arcviz util recommendation --dcname=Recommendation --file=/var/lib/arcadia/test.txt --write=/var/lib/arcadia/output.txt
CREATE ANALYTICAL VIEW `test`.`recommended_aview_1` STORED AS PARQUET AS SELECT c, count(a), d, sum(b) FROM test.recom1 GROUP BY c, d;
CREATE ANALYTICAL VIEW `test`.`recommended_aview_2` STORED AS PARQUET AS SELECT avg(e), g, h, ndv(f) FROM test.recom1 GROUP BY g, h;