CREATE TABLE un_int_tbl(
id INT NOT NULL,
c1 TINYINT UNSIGNED,
c2 TINYINT UNSIGNED NOT NULL,
c3 SMALLINT UNSIGNED,
c4 SMALLINT UNSIGNED NOT NULL,
c5 INT UNSIGNED,
c6 INT UNSIGNED NOT NULL,
c7 BIGINT UNSIGNED,
c8 BIGINT UNSIGNED NOT NULL);

CREATE TABLE un_int_tbl1(
id INT NOT NULL,
c1 TINYINT UNSIGNED,
c2 TINYINT UNSIGNED NOT NULL,
c3 SMALLINT UNSIGNED,
c4 SMALLINT UNSIGNED NOT NULL,
c5 INT UNSIGNED,
c6 INT UNSIGNED NOT NULL,
c7 BIGINT UNSIGNED,
c8 BIGINT UNSIGNED NOT NULL);

CREATE TABLE varbinary_tbl(
id INT,
c1 VARBINARY,
c2 VARBINARY NULL);

CREATE TABLE binary_tbl(
id INT,
c1 BINARY(4),
c2 BINARY(4) NULL);


CREATE MATERIALIZED VIEW un_int_array_agg_distinct AS SELECT
ARRAY_AGG(DISTINCT c1) AS c1,ARRAY_AGG(DISTINCT c2) AS c2, ARRAY_AGG(DISTINCT c3) AS c3, ARRAY_AGG(DISTINCT c4) AS c4, ARRAY_AGG(DISTINCT c5) AS c5, ARRAY_AGG(DISTINCT c6) AS c6, ARRAY_AGG(DISTINCT c7) AS c7, ARRAY_AGG(DISTINCT c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_array_agg_distinct_groupby AS SELECT
id, ARRAY_AGG(DISTINCT c1) AS c1,ARRAY_AGG(DISTINCT c2) AS c2, ARRAY_AGG(DISTINCT c3) AS c3, ARRAY_AGG(DISTINCT c4) AS c4, ARRAY_AGG(DISTINCT c5) AS c5, ARRAY_AGG(DISTINCT c6) AS c6, ARRAY_AGG(DISTINCT c7) AS c7, ARRAY_AGG(DISTINCT c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_array_agg_gby AS SELECT
id, ARRAY_AGG(c1) AS c1, ARRAY_AGG(c2) AS c2, ARRAY_AGG(c3) AS c3, ARRAY_AGG(c4) AS c4, ARRAY_AGG(c5) AS c5, ARRAY_AGG(c6) AS c6, ARRAY_AGG(c7) AS c7, ARRAY_AGG(c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_array_agg AS SELECT
ARRAY_AGG(c1) AS c1,
ARRAY_AGG(c2) AS c2,
ARRAY_AGG(c3) AS c3,
ARRAY_AGG(c4) AS c4,
ARRAY_AGG(c5) AS c5,
ARRAY_AGG(c6) AS c6,
ARRAY_AGG(c7) AS c7,
ARRAY_AGG(c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_array_agg_where AS SELECT
ARRAY_AGG(c1) FILTER(WHERE c2 > 45) AS f_c1,
ARRAY_AGG(c2) FILTER(WHERE c2 > 45) AS f_c2,
ARRAY_AGG(c3) FILTER(WHERE c2 > 45) AS f_c3,
ARRAY_AGG(c4) FILTER(WHERE c2 > 45) AS f_c4,
ARRAY_AGG(c5) FILTER(WHERE c2 > 45) AS f_c5,
ARRAY_AGG(c6) FILTER(WHERE c2 > 45) AS f_c6,
ARRAY_AGG(c7) FILTER(WHERE c2 > 45) AS f_c7,
ARRAY_AGG(c8) FILTER(WHERE c2 > 45) AS f_c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_array_agg_where_gby AS SELECT
id,
ARRAY_AGG(c1) FILTER(WHERE c2 > 45) AS f_c1,
ARRAY_AGG(c2) FILTER(WHERE c2 > 45) AS f_c2,
ARRAY_AGG(c3) FILTER(WHERE c2 > 45) AS f_c3,
ARRAY_AGG(c4) FILTER(WHERE c2 > 45) AS f_c4,
ARRAY_AGG(c5) FILTER(WHERE c2 > 45) AS f_c5,
ARRAY_AGG(c6) FILTER(WHERE c2 > 45) AS f_c6,
ARRAY_AGG(c7) FILTER(WHERE c2 > 45) AS f_c7,
ARRAY_AGG(c8) FILTER(WHERE c2 > 45) AS f_c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_count AS SELECT
COUNT(*) AS count
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_count_gby AS SELECT
id, COUNT(*) AS count
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_count_where AS SELECT
COUNT(*) FILTER(WHERE c2 > 45) AS count
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_count_where_gby AS SELECT
id, COUNT(*) FILTER(WHERE c2 > 45) AS count
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_count_col AS SELECT
COUNT(c1) AS c1,
COUNT(c2) AS c2,
COUNT(c3) AS c3,
COUNT(c4) AS c4,
COUNT(c5) AS c5,
COUNT(c6) AS c6,
COUNT(c7) AS c7,
COUNT(c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_count_col_distinct AS SELECT
COUNT(DISTINCT c1) AS c1,
COUNT(DISTINCT c2) AS c2,
COUNT(DISTINCT c3) AS c3,
COUNT(DISTINCT c4) AS c4,
COUNT(DISTINCT c5) AS c5,
COUNT(DISTINCT c6) AS c6,
COUNT(DISTINCT c7) AS c7,
COUNT(DISTINCT c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_count_col_distinct_gby AS SELECT
id,
COUNT(DISTINCT c1) AS c1,
COUNT(DISTINCT c2) AS c2,
COUNT(DISTINCT c3) AS c3,
COUNT(DISTINCT c4) AS c4,
COUNT(DISTINCT c5) AS c5,
COUNT(DISTINCT c6) AS c6,
COUNT(DISTINCT c7) AS c7,
COUNT(DISTINCT c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_count_col_gby AS SELECT
id,
COUNT(c1) AS c1,
COUNT(c2) AS c2,
COUNT(c3) AS c3,
COUNT(c4) AS c4,
COUNT(c5) AS c5,
COUNT(c6) AS c6,
COUNT(c7) AS c7,
COUNT(c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_count_col_where AS SELECT
COUNT(c1) FILTER(WHERE c2 > 45) AS c1,
COUNT(c2) FILTER(WHERE c2 > 45) AS c2,
COUNT(c3) FILTER(WHERE c2 > 45) AS c3,
COUNT(c4) FILTER(WHERE c2 > 45) AS c4,
COUNT(c5) FILTER(WHERE c2 > 45) AS c5,
COUNT(c6) FILTER(WHERE c2 > 45) AS c6,
COUNT(c7) FILTER(WHERE c2 > 45) AS c7,
COUNT(c8) FILTER(WHERE c2 > 45) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_count_col_where_gby AS SELECT
id,
COUNT(c1) FILTER(WHERE c2 > 45) AS c1,
COUNT(c2) FILTER(WHERE c2 > 45) AS c2,
COUNT(c3) FILTER(WHERE c2 > 45) AS c3,
COUNT(c4) FILTER(WHERE c2 > 45) AS c4,
COUNT(c5) FILTER(WHERE c2 > 45) AS c5,
COUNT(c6) FILTER(WHERE c2 > 45) AS c6,
COUNT(c7) FILTER(WHERE c2 > 45) AS c7,
COUNT(c8) FILTER(WHERE c2 > 45) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_countif AS SELECT
COUNTIF(c1 > 61) AS c1,
COUNTIF(c2 > 45) AS c2,
COUNTIF(c3 > 12876) AS c3,
COUNTIF(c4 > 13532) AS c4,
COUNTIF(c5 > 709123456) AS c5,
COUNTIF(c6 > 651238977) AS c6,
COUNTIF(c7 > 367192837461) AS c7,
COUNTIF(c8 > 265928374652) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_countif_distinct AS SELECT
COUNTIF(DISTINCT c1 > 61) AS c1,
COUNTIF(DISTINCT c2 > 45) AS c2,
COUNTIF(DISTINCT c3 > 12876) AS c3,
COUNTIF(DISTINCT c4 > 13532) AS c4,
COUNTIF(DISTINCT c5 > 709123456) AS c5,
COUNTIF(DISTINCT c6 > 651238977) AS c6,
COUNTIF(DISTINCT c7 > 367192837461) AS c7,
COUNTIF(DISTINCT c8 > 265928374652) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_countif_distinct_gby AS SELECT
id,
COUNTIF(DISTINCT c1 > 61) AS c1,
COUNTIF(DISTINCT c2 > 45) AS c2,
COUNTIF(DISTINCT c3 > 12876) AS c3,
COUNTIF(DISTINCT c4 > 13532) AS c4,
COUNTIF(DISTINCT c5 > 709123456) AS c5,
COUNTIF(DISTINCT c6 > 651238977) AS c6,
COUNTIF(DISTINCT c7 > 367192837461) AS c7,
COUNTIF(DISTINCT c8 > 265928374652) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_countif_gby AS SELECT
id,
COUNTIF(c1 > 61) AS c1,
COUNTIF(c2 > 45) AS c2,
COUNTIF(c3 > 12876) AS c3,
COUNTIF(c4 > 13532) AS c4,
COUNTIF(c5 > 709123456) AS c5,
COUNTIF(c6 > 651238977) AS c6,
COUNTIF(c7 > 367192837461) AS c7,
COUNTIF(c8 > 265928374652) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_countif_where AS SELECT
COUNTIF(c1 > 61) FILTER(WHERE c7 IS NOT NULL) AS c1,
COUNTIF(c2 > 45) FILTER(WHERE c7 IS NOT NULL) AS c2,
COUNTIF(c3 > 12876) FILTER(WHERE c7 IS NOT NULL) AS c3,
COUNTIF(c4 > 13532) FILTER(WHERE c7 IS NOT NULL) AS c4,
COUNTIF(c5 > 709123456) FILTER(WHERE c7 IS NOT NULL) AS c5,
COUNTIF(c6 > 651238977) FILTER(WHERE c7 IS NOT NULL) AS c6,
COUNTIF(c7 > 367192837461) FILTER(WHERE c7 IS NOT NULL) AS c7,
COUNTIF(c8 > 265928374652) FILTER(WHERE c7 IS NOT NULL) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_countif_where_gby AS SELECT
id,
COUNTIF(c1 > 61) FILTER(WHERE c7 IS NOT NULL) AS c1,
COUNTIF(c2 > 45) FILTER(WHERE c7 IS NOT NULL) AS c2,
COUNTIF(c3 > 12876) FILTER(WHERE c7 IS NOT NULL) AS c3,
COUNTIF(c4 > 13532) FILTER(WHERE c7 IS NOT NULL) AS c4,
COUNTIF(c5 > 709123456) FILTER(WHERE c7 IS NOT NULL) AS c5,
COUNTIF(c6 > 651238977) FILTER(WHERE c7 IS NOT NULL) AS c6,
COUNTIF(c7 > 367192837461) FILTER(WHERE c7 IS NOT NULL) AS c7,
COUNTIF(c8 > 265928374652) FILTER(WHERE c7 IS NOT NULL) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_arg_max_value AS SELECT
ARG_MAX(c1, c2) AS c1,
ARG_MAX(c2, c1) AS c2,
ARG_MAX(c3, c4) AS c3,
ARG_MAX(c4, c3) AS c4,
ARG_MAX(c5, c6) AS c5,
ARG_MAX(c6, c5) AS c6,
ARG_MAX(c7, c8) AS c7,
ARG_MAX(c8, c7) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_arg_max_distinct_gby AS SELECT
id,
ARG_MAX(DISTINCT c1, c2) AS c1,
ARG_MAX(DISTINCT c2, c1) AS c2,
ARG_MAX(DISTINCT c3, c4) AS c3,
ARG_MAX(DISTINCT c4, c3) AS c4,
ARG_MAX(DISTINCT c5, c6) AS c5,
ARG_MAX(DISTINCT c6, c5) AS c6,
ARG_MAX(DISTINCT c7, c8) AS c7,
ARG_MAX(DISTINCT c8, c7) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_arg_max_where AS SELECT
ARG_MAX(c1, c2) FILTER(WHERE c4>13450) AS f_c1,
ARG_MAX(c2, c1) FILTER(WHERE c4>13450) AS f_c2,
ARG_MAX(c3, c4) FILTER(WHERE c4>13450) AS f_c3,
ARG_MAX(c4, c3) FILTER(WHERE c4>13450) AS f_c4,
ARG_MAX(c5, c6) FILTER(WHERE c4>13450) AS f_c5,
ARG_MAX(c6, c5) FILTER(WHERE c4>13450) AS f_c6,
ARG_MAX(c7, c8) FILTER(WHERE c4>13450) AS f_c7,
ARG_MAX(c8, c7) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_arg_max_where_gby AS SELECT
id,
ARG_MAX(c1, c2) FILTER(WHERE c4>13450) AS f_c1,
ARG_MAX(c2, c1) FILTER(WHERE c4>13450) AS f_c2,
ARG_MAX(c3, c4) FILTER(WHERE c4>13450) AS f_c3,
ARG_MAX(c4, c3) FILTER(WHERE c4>13450) AS f_c4,
ARG_MAX(c5, c6) FILTER(WHERE c4>13450) AS f_c5,
ARG_MAX(c6, c5) FILTER(WHERE c4>13450) AS f_c6,
ARG_MAX(c7, c8) FILTER(WHERE c4>13450) AS f_c7,
ARG_MAX(c8, c7) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_arg_max_distinct AS SELECT
ARG_MAX(DISTINCT c1, c2) AS c1,
ARG_MAX(DISTINCT c2, c1) AS c2,
ARG_MAX(DISTINCT c3, c4) AS c3,
ARG_MAX(DISTINCT c4, c3) AS c4,
ARG_MAX(DISTINCT c5, c6) AS c5,
ARG_MAX(DISTINCT c6, c5) AS c6,
ARG_MAX(DISTINCT c7, c8) AS c7,
ARG_MAX(DISTINCT c8, c7) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_arg_max_gby AS SELECT
id,
ARG_MAX(c1, c2) AS c1,
ARG_MAX(c2, c1) AS c2,
ARG_MAX(c3, c4) AS c3,
ARG_MAX(c4, c3) AS c4,
ARG_MAX(c5, c6) AS c5,
ARG_MAX(c6, c5) AS c6,
ARG_MAX(c7, c8) AS c7,
ARG_MAX(c8, c7) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_arg_min_value AS SELECT
ARG_MIN(c1, c2) AS c1,
ARG_MIN(c2, c1) AS c2,
ARG_MIN(c3, c4) AS c3,
ARG_MIN(c4, c3) AS c4,
ARG_MIN(c5, c6) AS c5,
ARG_MIN(c6, c5) AS c6,
ARG_MIN(c7, c8) AS c7,
ARG_MIN(c8, c7) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_arg_min_distinct AS SELECT
ARG_MIN(DISTINCT c1, c2) AS c1,
ARG_MIN(DISTINCT c2, c1) AS c2,
ARG_MIN(DISTINCT c3, c4) AS c3,
ARG_MIN(DISTINCT c4, c3) AS c4,
ARG_MIN(DISTINCT c5, c6) AS c5,
ARG_MIN(DISTINCT c6, c5) AS c6,
ARG_MIN(DISTINCT c7, c8) AS c7,
ARG_MIN(DISTINCT c8, c7) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_arg_min_distinct_gby AS SELECT
id,
ARG_MIN(DISTINCT c1, c2) AS c1,
ARG_MIN(DISTINCT c2, c1) AS c2,
ARG_MIN(DISTINCT c3, c4) AS c3,
ARG_MIN(DISTINCT c4, c3) AS c4,
ARG_MIN(DISTINCT c5, c6) AS c5,
ARG_MIN(DISTINCT c6, c5) AS c6,
ARG_MIN(DISTINCT c7, c8) AS c7,
ARG_MIN(DISTINCT c8, c7) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_arg_min_gby AS SELECT
id,
ARG_MIN(c1, c2) AS c1,
ARG_MIN(c2, c1) AS c2,
ARG_MIN(c3, c4) AS c3,
ARG_MIN(c4, c3) AS c4,
ARG_MIN(c5, c6) AS c5,
ARG_MIN(c6, c5) AS c6,
ARG_MIN(c7, c8) AS c7,
ARG_MIN(c8, c7) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_arg_min_where AS SELECT
ARG_MIN(c1, c2) FILTER(WHERE c4>13450) AS f_c1,
ARG_MIN(c2, c1) FILTER(WHERE c4>13450) AS f_c2,
ARG_MIN(c3, c4) FILTER(WHERE c4>13450) AS f_c3,
ARG_MIN(c4, c3) FILTER(WHERE c4>13450) AS f_c4,
ARG_MIN(c5, c6) FILTER(WHERE c4>13450) AS f_c5,
ARG_MIN(c6, c5) FILTER(WHERE c4>13450) AS f_c6,
ARG_MIN(c7, c8) FILTER(WHERE c4>13450) AS f_c7,
ARG_MIN(c8, c7) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_arg_min_where_gby AS SELECT
id,
ARG_MIN(c1, c2) FILTER(WHERE c4>13450) AS f_c1,
ARG_MIN(c2, c1) FILTER(WHERE c4>13450) AS f_c2,
ARG_MIN(c3, c4) FILTER(WHERE c4>13450) AS f_c3,
ARG_MIN(c4, c3) FILTER(WHERE c4>13450) AS f_c4,
ARG_MIN(c5, c6) FILTER(WHERE c4>13450) AS f_c5,
ARG_MIN(c6, c5) FILTER(WHERE c4>13450) AS f_c6,
ARG_MIN(c7, c8) FILTER(WHERE c4>13450) AS f_c7,
ARG_MIN(c8, c7) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_avg_value AS SELECT
AVG(c1) AS c1,
AVG(c2) AS c2,
AVG(c3) AS c3,
AVG(c4) AS c4,
AVG(c5) AS c5,
AVG(c6) AS c6,
AVG(c7) AS c7,
AVG(c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_avg_distinct AS SELECT
AVG(DISTINCT c1) AS c1,
AVG(DISTINCT c2) AS c2,
AVG(DISTINCT c3) AS c3,
AVG(DISTINCT c4) AS c4,
AVG(DISTINCT c5) AS c5,
AVG(DISTINCT c6) AS c6,
AVG(DISTINCT c7) AS c7,
AVG(DISTINCT c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_avg_distinct_gby AS SELECT
id,
AVG(DISTINCT c1) AS c1,
AVG(DISTINCT c2) AS c2,
AVG(DISTINCT c3) AS c3,
AVG(DISTINCT c4) AS c4,
AVG(DISTINCT c5) AS c5,
AVG(DISTINCT c6) AS c6,
AVG(DISTINCT c7) AS c7,
AVG(DISTINCT c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_avg_gby AS SELECT
id,
AVG(c1) AS c1,
AVG(c2) AS c2,
AVG(c3) AS c3,
AVG(c4) AS c4,
AVG(c5) AS c5,
AVG(c6) AS c6,
AVG(c7) AS c7,
AVG(c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_avg_where AS SELECT
AVG(c1) FILTER(WHERE c4>13450) AS f_c1,
AVG(c2) FILTER(WHERE c4>13450) AS f_c2,
AVG(c3) FILTER(WHERE c4>13450) AS f_c3,
AVG(c4) FILTER(WHERE c4>13450) AS f_c4,
AVG(c5) FILTER(WHERE c4>13450) AS f_c5,
AVG(c6) FILTER(WHERE c4>13450) AS f_c6,
AVG(c7) FILTER(WHERE c4>13450) AS f_c7,
AVG(c8) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_avg_where_gby AS SELECT
id,
AVG(c1) FILTER(WHERE c4>13450) AS f_c1,
AVG(c2) FILTER(WHERE c4>13450) AS f_c2,
AVG(c3) FILTER(WHERE c4>13450) AS f_c3,
AVG(c4) FILTER(WHERE c4>13450) AS f_c4,
AVG(c5) FILTER(WHERE c4>13450) AS f_c5,
AVG(c6) FILTER(WHERE c4>13450) AS f_c6,
AVG(c7) FILTER(WHERE c4>13450) AS f_c7,
AVG(c8) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_max_value AS SELECT
MAX(c1) AS c1,
MAX(c2) AS c2,
MAX(c3) AS c3,
MAX(c4) AS c4,
MAX(c5) AS c5,
MAX(c6) AS c6,
MAX(c7) AS c7,
MAX(c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_max_distinct AS SELECT
MAX(DISTINCT c1) AS c1,
MAX(DISTINCT c2) AS c2,
MAX(DISTINCT c3) AS c3,
MAX(DISTINCT c4) AS c4,
MAX(DISTINCT c5) AS c5,
MAX(DISTINCT c6) AS c6,
MAX(DISTINCT c7) AS c7,
MAX(DISTINCT c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_max_distinct_gby AS SELECT
id,
MAX(DISTINCT c1) AS c1,
MAX(DISTINCT c2) AS c2,
MAX(DISTINCT c3) AS c3,
MAX(DISTINCT c4) AS c4,
MAX(DISTINCT c5) AS c5,
MAX(DISTINCT c6) AS c6,
MAX(DISTINCT c7) AS c7,
MAX(DISTINCT c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_max_gby AS SELECT
id,
MAX(c1) AS c1,
MAX(c2) AS c2,
MAX(c3) AS c3,
MAX(c4) AS c4,
MAX(c5) AS c5,
MAX(c6) AS c6,
MAX(c7) AS c7,
MAX(c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_max_where AS SELECT
MAX(c1) FILTER(WHERE c4>13450) AS f_c1,
MAX(c2) FILTER(WHERE c4>13450) AS f_c2,
MAX(c3) FILTER(WHERE c4>13450) AS f_c3,
MAX(c4) FILTER(WHERE c4>13450) AS f_c4,
MAX(c5) FILTER(WHERE c4>13450) AS f_c5,
MAX(c6) FILTER(WHERE c4>13450) AS f_c6,
MAX(c7) FILTER(WHERE c4>13450) AS f_c7,
MAX(c8) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_max_where_gby AS SELECT
id,
MAX(c1) FILTER(WHERE c4>13450) AS f_c1,
MAX(c2) FILTER(WHERE c4>13450) AS f_c2,
MAX(c3) FILTER(WHERE c4>13450) AS f_c3,
MAX(c4) FILTER(WHERE c4>13450) AS f_c4,
MAX(c5) FILTER(WHERE c4>13450) AS f_c5,
MAX(c6) FILTER(WHERE c4>13450) AS f_c6,
MAX(c7) FILTER(WHERE c4>13450) AS f_c7,
MAX(c8) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_min_value AS SELECT
MIN(c1) AS c1,
MIN(c2) AS c2,
MIN(c3) AS c3,
MIN(c4) AS c4,
MIN(c5) AS c5,
MIN(c6) AS c6,
MIN(c7) AS c7,
MIN(c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_min_distinct AS SELECT
MIN(DISTINCT c1) AS c1,
MIN(DISTINCT c2) AS c2,
MIN(DISTINCT c3) AS c3,
MIN(DISTINCT c4) AS c4,
MIN(DISTINCT c5) AS c5,
MIN(DISTINCT c6) AS c6,
MIN(DISTINCT c7) AS c7,
MIN(DISTINCT c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_min_distinct_gby AS SELECT
id,
MIN(DISTINCT c1) AS c1,
MIN(DISTINCT c2) AS c2,
MIN(DISTINCT c3) AS c3,
MIN(DISTINCT c4) AS c4,
MIN(DISTINCT c5) AS c5,
MIN(DISTINCT c6) AS c6,
MIN(DISTINCT c7) AS c7,
MIN(DISTINCT c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_min_gby AS SELECT
id,
MIN(c1) AS c1,
MIN(c2) AS c2,
MIN(c3) AS c3,
MIN(c4) AS c4,
MIN(c5) AS c5,
MIN(c6) AS c6,
MIN(c7) AS c7,
MIN(c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_min_where AS SELECT
MIN(c1) FILTER(WHERE c4>13450) AS f_c1,
MIN(c2) FILTER(WHERE c4>13450) AS f_c2,
MIN(c3) FILTER(WHERE c4>13450) AS f_c3,
MIN(c4) FILTER(WHERE c4>13450) AS f_c4,
MIN(c5) FILTER(WHERE c4>13450) AS f_c5,
MIN(c6) FILTER(WHERE c4>13450) AS f_c6,
MIN(c7) FILTER(WHERE c4>13450) AS f_c7,
MIN(c8) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_min_where_gby AS SELECT
id,
MIN(c1) FILTER(WHERE c4>13450) AS f_c1,
MIN(c2) FILTER(WHERE c4>13450) AS f_c2,
MIN(c3) FILTER(WHERE c4>13450) AS f_c3,
MIN(c4) FILTER(WHERE c4>13450) AS f_c4,
MIN(c5) FILTER(WHERE c4>13450) AS f_c5,
MIN(c6) FILTER(WHERE c4>13450) AS f_c6,
MIN(c7) FILTER(WHERE c4>13450) AS f_c7,
MIN(c8) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_sum_value AS SELECT
SUM(c1) AS c1,
SUM(c2) AS c2,
SUM(c3) AS c3,
SUM(c4) AS c4,
SUM(c5) AS c5,
SUM(c6) AS c6,
SUM(c7) AS c7,
SUM(c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_sum_distinct AS SELECT
SUM(DISTINCT c1) AS c1,
SUM(DISTINCT c2) AS c2,
SUM(DISTINCT c3) AS c3,
SUM(DISTINCT c4) AS c4,
SUM(DISTINCT c5) AS c5,
SUM(DISTINCT c6) AS c6,
SUM(DISTINCT c7) AS c7,
SUM(DISTINCT c8) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_sum_distinct_gby AS SELECT
id,
SUM(DISTINCT c1) AS c1,
SUM(DISTINCT c2) AS c2,
SUM(DISTINCT c3) AS c3,
SUM(DISTINCT c4) AS c4,
SUM(DISTINCT c5) AS c5,
SUM(DISTINCT c6) AS c6,
SUM(DISTINCT c7) AS c7,
SUM(DISTINCT c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_sum_gby AS SELECT
id,
SUM(c1) AS c1,
SUM(c2) AS c2,
SUM(c3) AS c3,
SUM(c4) AS c4,
SUM(c5) AS c5,
SUM(c6) AS c6,
SUM(c7) AS c7,
SUM(c8) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_sum_where AS SELECT
SUM(c1) FILTER(WHERE c4>13450) AS f_c1,
SUM(c2) FILTER(WHERE c4>13450) AS f_c2,
SUM(c3) FILTER(WHERE c4>13450) AS f_c3,
SUM(c4) FILTER(WHERE c4>13450) AS f_c4,
SUM(c5) FILTER(WHERE c4>13450) AS f_c5,
SUM(c6) FILTER(WHERE c4>13450) AS f_c6,
SUM(c7) FILTER(WHERE c4>13450) AS f_c7,
SUM(c8) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_sum_where_gby AS SELECT
id,
SUM(c1) FILTER(WHERE c4>13450) AS f_c1,
SUM(c2) FILTER(WHERE c4>13450) AS f_c2,
SUM(c3) FILTER(WHERE c4>13450) AS f_c3,
SUM(c4) FILTER(WHERE c4>13450) AS f_c4,
SUM(c5) FILTER(WHERE c4>13450) AS f_c5,
SUM(c6) FILTER(WHERE c4>13450) AS f_c6,
SUM(c7) FILTER(WHERE c4>13450) AS f_c7,
SUM(c8) FILTER(WHERE c4>13450) AS f_c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_every AS SELECT
EVERY(c1 > 61) AS c1,
EVERY(c2 > 45) AS c2,
EVERY(c3 > 12876) AS c3,
EVERY(c4 > 13532) AS c4,
EVERY(c5 > 709123456) AS c5,
EVERY(c6 > 651238977) AS c6,
EVERY(c7 > 367192837461) AS c7,
EVERY(c8 > 265928374652) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_every_distinct AS SELECT
EVERY(DISTINCT c1 > 61) AS c1,
EVERY(DISTINCT c2 > 45) AS c2,
EVERY(DISTINCT c3 > 12876) AS c3,
EVERY(DISTINCT c4 > 13532) AS c4,
EVERY(DISTINCT c5 > 709123456) AS c5,
EVERY(DISTINCT c6 > 651238977) AS c6,
EVERY(DISTINCT c7 > 367192837461) AS c7,
EVERY(DISTINCT c8 > 265928374652) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_every_distinct_gby AS SELECT
id,
EVERY(DISTINCT c1 > 61) AS c1,
EVERY(DISTINCT c2 > 45) AS c2,
EVERY(DISTINCT c3 > 12876) AS c3,
EVERY(DISTINCT c4 > 13532) AS c4,
EVERY(DISTINCT c5 > 709123456) AS c5,
EVERY(DISTINCT c6 > 651238977) AS c6,
EVERY(DISTINCT c7 > 367192837461) AS c7,
EVERY(DISTINCT c8 > 265928374652) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_every_gby AS SELECT
id,
EVERY(c1 > 61) AS c1,
EVERY(c2 > 45) AS c2,
EVERY(c3 > 12876) AS c3,
EVERY(c4 > 13532) AS c4,
EVERY(c5 > 709123456) AS c5,
EVERY(c6 > 651238977) AS c6,
EVERY(c7 > 367192837461) AS c7,
EVERY(c8 > 265928374652) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_every_where AS SELECT
EVERY(c1 > 61) FILTER(WHERE c7 IS NOT NULL) AS c1,
EVERY(c2 > 45) FILTER(WHERE c7 IS NOT NULL) AS c2,
EVERY(c3 > 12876) FILTER(WHERE c7 IS NOT NULL) AS c3,
EVERY(c4 > 13532) FILTER(WHERE c7 IS NOT NULL) AS c4,
EVERY(c5 > 709123456) FILTER(WHERE c7 IS NOT NULL) AS c5,
EVERY(c6 > 651238977) FILTER(WHERE c7 IS NOT NULL) AS c6,
EVERY(c7 > 367192837461) FILTER(WHERE c7 IS NOT NULL) AS c7,
EVERY(c8 > 265928374652) FILTER(WHERE c7 IS NOT NULL) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_every_where_gby AS SELECT
id,
EVERY(c1 > 61) FILTER(WHERE c7 IS NOT NULL) AS c1,
EVERY(c2 > 45) FILTER(WHERE c7 IS NOT NULL) AS c2,
EVERY(c3 > 12876) FILTER(WHERE c7 IS NOT NULL) AS c3,
EVERY(c4 > 13532) FILTER(WHERE c7 IS NOT NULL) AS c4,
EVERY(c5 > 709123456) FILTER(WHERE c7 IS NOT NULL) AS c5,
EVERY(c6 > 651238977) FILTER(WHERE c7 IS NOT NULL) AS c6,
EVERY(c7 > 367192837461) FILTER(WHERE c7 IS NOT NULL) AS c7,
EVERY(c8 > 265928374652) FILTER(WHERE c7 IS NOT NULL) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_some AS SELECT
SOME(c1 > 61) AS c1,
SOME(c2 > 45) AS c2,
SOME(c3 > 12876) AS c3,
SOME(c4 > 13532) AS c4,
SOME(c5 > 709123456) AS c5,
SOME(c6 > 651238977) AS c6,
SOME(c7 > 367192837461) AS c7,
SOME(c8 > 265928374652) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_some_distinct AS SELECT
SOME(DISTINCT c1 > 61) AS c1,
SOME(DISTINCT c2 > 45) AS c2,
SOME(DISTINCT c3 > 12876) AS c3,
SOME(DISTINCT c4 > 13532) AS c4,
SOME(DISTINCT c5 > 709123456) AS c5,
SOME(DISTINCT c6 > 651238977) AS c6,
SOME(DISTINCT c7 > 367192837461) AS c7,
SOME(DISTINCT c8 > 265928374652) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_some_distinct_gby AS SELECT
id,
SOME(DISTINCT c1 > 61) AS c1,
SOME(DISTINCT c2 > 45) AS c2,
SOME(DISTINCT c3 > 12876) AS c3,
SOME(DISTINCT c4 > 13532) AS c4,
SOME(DISTINCT c5 > 709123456) AS c5,
SOME(DISTINCT c6 > 651238977) AS c6,
SOME(DISTINCT c7 > 367192837461) AS c7,
SOME(DISTINCT c8 > 265928374652) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_some_gby AS SELECT
id,
SOME(c1 > 61) AS c1,
SOME(c2 > 45) AS c2,
SOME(c3 > 12876) AS c3,
SOME(c4 > 13532) AS c4,
SOME(c5 > 709123456) AS c5,
SOME(c6 > 651238977) AS c6,
SOME(c7 > 367192837461) AS c7,
SOME(c8 > 265928374652) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_some_where AS SELECT
SOME(c1 > 61) FILTER(WHERE c7 IS NOT NULL) AS c1,
SOME(c2 > 45) FILTER(WHERE c7 IS NOT NULL) AS c2,
SOME(c3 > 12876) FILTER(WHERE c7 IS NOT NULL) AS c3,
SOME(c4 > 13532) FILTER(WHERE c7 IS NOT NULL) AS c4,
SOME(c5 > 709123456) FILTER(WHERE c7 IS NOT NULL) AS c5,
SOME(c6 > 651238977) FILTER(WHERE c7 IS NOT NULL) AS c6,
SOME(c7 > 367192837461) FILTER(WHERE c7 IS NOT NULL) AS c7,
SOME(c8 > 265928374652) FILTER(WHERE c7 IS NOT NULL) AS c8
FROM un_int_tbl;

CREATE MATERIALIZED VIEW un_int_some_where_gby AS SELECT
id,
SOME(c1 > 61) FILTER(WHERE c7 IS NOT NULL) AS c1,
SOME(c2 > 45) FILTER(WHERE c7 IS NOT NULL) AS c2,
SOME(c3 > 12876) FILTER(WHERE c7 IS NOT NULL) AS c3,
SOME(c4 > 13532) FILTER(WHERE c7 IS NOT NULL) AS c4,
SOME(c5 > 709123456) FILTER(WHERE c7 IS NOT NULL) AS c5,
SOME(c6 > 651238977) FILTER(WHERE c7 IS NOT NULL) AS c6,
SOME(c7 > 367192837461) FILTER(WHERE c7 IS NOT NULL) AS c7,
SOME(c8 > 265928374652) FILTER(WHERE c7 IS NOT NULL) AS c8
FROM un_int_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_stddev_value AS SELECT
STDDEV_SAMP(c1) AS c1,
STDDEV_SAMP(c2) AS c2,
STDDEV_SAMP(c3) AS c3,
STDDEV_SAMP(c4) AS c4,
STDDEV_SAMP(c5) AS c5,
STDDEV_SAMP(c6) AS c6,
STDDEV_SAMP(c7) AS c7,
STDDEV_SAMP(c8) AS c8
FROM un_int_tbl1;

CREATE MATERIALIZED VIEW un_stddev_min_distinct AS SELECT
STDDEV_SAMP(DISTINCT c1) AS c1,
STDDEV_SAMP(DISTINCT c2) AS c2,
STDDEV_SAMP(DISTINCT c3) AS c3,
STDDEV_SAMP(DISTINCT c4) AS c4,
STDDEV_SAMP(DISTINCT c5) AS c5,
STDDEV_SAMP(DISTINCT c6) AS c6,
STDDEV_SAMP(DISTINCT c7) AS c7,
STDDEV_SAMP(DISTINCT c8) AS c8
FROM un_int_tbl1;

CREATE MATERIALIZED VIEW un_int_stddev_distinct_gby AS SELECT
id,
STDDEV_SAMP(DISTINCT c1) AS c1,
STDDEV_SAMP(DISTINCT c2) AS c2,
STDDEV_SAMP(DISTINCT c3) AS c3,
STDDEV_SAMP(DISTINCT c4) AS c4,
STDDEV_SAMP(DISTINCT c5) AS c5,
STDDEV_SAMP(DISTINCT c6) AS c6,
STDDEV_SAMP(DISTINCT c7) AS c7,
STDDEV_SAMP(DISTINCT c8) AS c8
FROM un_int_tbl1
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_stddev_gby AS SELECT
id,
STDDEV_SAMP(c1) AS c1,
STDDEV_SAMP(c2) AS c2,
STDDEV_SAMP(c3) AS c3,
STDDEV_SAMP(c4) AS c4,
STDDEV_SAMP(c5) AS c5,
STDDEV_SAMP(c6) AS c6,
STDDEV_SAMP(c7) AS c7,
STDDEV_SAMP(c8) AS c8
FROM un_int_tbl1
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_stddev_where AS SELECT
STDDEV_SAMP(c1) FILTER(WHERE c4>1200) AS f_c1,
STDDEV_SAMP(c2) FILTER(WHERE c4>1200) AS f_c2,
STDDEV_SAMP(c3) FILTER(WHERE c4>1200) AS f_c3,
STDDEV_SAMP(c4) FILTER(WHERE c4>1200) AS f_c4,
STDDEV_SAMP(c5) FILTER(WHERE c4>1200) AS f_c5,
STDDEV_SAMP(c6) FILTER(WHERE c4>1200) AS f_c6,
STDDEV_SAMP(c7) FILTER(WHERE c4>1200) AS f_c7,
STDDEV_SAMP(c8) FILTER(WHERE c4>1200) AS f_c8
FROM un_int_tbl1;

CREATE MATERIALIZED VIEW un_int_stddev_where_gby AS SELECT
id,
STDDEV_SAMP(c1) FILTER(WHERE c4>1200) AS f_c1,
STDDEV_SAMP(c2) FILTER(WHERE c4>1200) AS f_c2,
STDDEV_SAMP(c3) FILTER(WHERE c4>1200) AS f_c3,
STDDEV_SAMP(c4) FILTER(WHERE c4>1200) AS f_c4,
STDDEV_SAMP(c5) FILTER(WHERE c4>1200) AS f_c5,
STDDEV_SAMP(c6) FILTER(WHERE c4>1200) AS f_c6,
STDDEV_SAMP(c7) FILTER(WHERE c4>1200) AS f_c7,
STDDEV_SAMP(c8) FILTER(WHERE c4>1200) AS f_c8
FROM un_int_tbl1
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_stddev_pop AS SELECT
STDDEV_POP(c1) AS c1,
STDDEV_POP(c2) AS c2,
STDDEV_POP(c3) AS c3,
STDDEV_POP(c4) AS c4,
STDDEV_POP(c5) AS c5,
STDDEV_POP(c6) AS c6,
STDDEV_POP(c7) AS c7,
STDDEV_POP(c8) AS c8
FROM un_int_tbl1;

CREATE MATERIALIZED VIEW un_stddev_pop_min_distinct AS SELECT
STDDEV_POP(DISTINCT c1) AS c1,
STDDEV_POP(DISTINCT c2) AS c2,
STDDEV_POP(DISTINCT c3) AS c3,
STDDEV_POP(DISTINCT c4) AS c4,
STDDEV_POP(DISTINCT c5) AS c5,
STDDEV_POP(DISTINCT c6) AS c6,
STDDEV_POP(DISTINCT c7) AS c7,
STDDEV_POP(DISTINCT c8) AS c8
FROM un_int_tbl1;

CREATE MATERIALIZED VIEW un_int_stddev_pop_distinct_gby AS SELECT
id,
STDDEV_POP(DISTINCT c1) AS c1,
STDDEV_POP(DISTINCT c2) AS c2,
STDDEV_POP(DISTINCT c3) AS c3,
STDDEV_POP(DISTINCT c4) AS c4,
STDDEV_POP(DISTINCT c5) AS c5,
STDDEV_POP(DISTINCT c6) AS c6,
STDDEV_POP(DISTINCT c7) AS c7,
STDDEV_POP(DISTINCT c8) AS c8
FROM un_int_tbl1
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_stddev_pop_gby AS SELECT
id,
STDDEV_POP(c1) AS c1,
STDDEV_POP(c2) AS c2,
STDDEV_POP(c3) AS c3,
STDDEV_POP(c4) AS c4,
STDDEV_POP(c5) AS c5,
STDDEV_POP(c6) AS c6,
STDDEV_POP(c7) AS c7,
STDDEV_POP(c8) AS c8
FROM un_int_tbl1
GROUP BY id;

CREATE MATERIALIZED VIEW un_int_stddev_pop_where AS SELECT
STDDEV_POP(c1) FILTER(WHERE c4>1200) AS f_c1,
STDDEV_POP(c2) FILTER(WHERE c4>1200) AS f_c2,
STDDEV_POP(c3) FILTER(WHERE c4>1200) AS f_c3,
STDDEV_POP(c4) FILTER(WHERE c4>1200) AS f_c4,
STDDEV_POP(c5) FILTER(WHERE c4>1200) AS f_c5,
STDDEV_POP(c6) FILTER(WHERE c4>1200) AS f_c6,
STDDEV_POP(c7) FILTER(WHERE c4>1200) AS f_c7,
STDDEV_POP(c8) FILTER(WHERE c4>1200) AS f_c8
FROM un_int_tbl1;

CREATE MATERIALIZED VIEW un_int_stddev_pop_where_gby AS SELECT
id,
STDDEV_POP(c1) FILTER(WHERE c4>1200) AS f_c1,
STDDEV_POP(c2) FILTER(WHERE c4>1200) AS f_c2,
STDDEV_POP(c3) FILTER(WHERE c4>1200) AS f_c3,
STDDEV_POP(c4) FILTER(WHERE c4>1200) AS f_c4,
STDDEV_POP(c5) FILTER(WHERE c4>1200) AS f_c5,
STDDEV_POP(c6) FILTER(WHERE c4>1200) AS f_c6,
STDDEV_POP(c7) FILTER(WHERE c4>1200) AS f_c7,
STDDEV_POP(c8) FILTER(WHERE c4>1200) AS f_c8
FROM un_int_tbl1
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_arg_min_distinct AS SELECT
ARG_MIN(DISTINCT c1, c2) AS c1, ARG_MIN(DISTINCT c2, c1) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_arg_min_distinct_gby AS SELECT
id, ARG_MIN(DISTINCT c1, c2) AS c1, ARG_MIN(DISTINCT c2, c1) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_arg_min_gby AS SELECT
id, ARG_MIN(c1, c2) AS c1, ARG_MIN(c2, c1) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_arg_min AS SELECT
ARG_MIN(c1, c2) AS c1, ARG_MIN(c2, c1) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_arg_min_where AS SELECT
ARG_MIN(c1, c2) FILTER(WHERE c1 < c2) AS c1, ARG_MIN(c2, c1) FILTER(WHERE c1 < c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_arg_min_where_gby AS SELECT
id, ARG_MIN(c1, c2) FILTER(WHERE c1 < c2) AS c1, ARG_MIN(c2, c1) FILTER(WHERE c1 < c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_arg_max_distinct AS SELECT
ARG_MAX(DISTINCT c1, c2) AS c1, ARG_MAX(DISTINCT c2, c1) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_arg_max_distinct_gby AS SELECT
id, ARG_MAX(DISTINCT c1, c2) AS c1, ARG_MAX(DISTINCT c2, c1) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_arg_max_gby AS SELECT
id, ARG_MAX(c1, c2) AS c1, ARG_MAX(c2, c1) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_arg_max AS SELECT
ARG_MAX(c1, c2) AS c1, ARG_MAX(c2, c1) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_arg_max_where AS SELECT
ARG_MAX(c1, c2) FILTER(WHERE c1 < c2) AS c1, ARG_MAX(c2, c1) FILTER(WHERE c1 < c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_arg_max_where_gby AS SELECT
id, ARG_MAX(c1, c2) FILTER(WHERE c1 < c2) AS c1, ARG_MAX(c2, c1) FILTER(WHERE c1 < c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_array_agg_distinct AS SELECT
ARRAY_AGG(DISTINCT c1) AS c1, ARRAY_AGG(DISTINCT c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_array_agg_distinct_gby AS SELECT
id, ARRAY_AGG(DISTINCT c1) AS c1, ARRAY_AGG(DISTINCT c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_array_agg_gby AS SELECT
id, ARRAY_AGG(c1) AS c1, ARRAY_AGG(c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_array_agg AS SELECT
ARRAY_AGG(c1) AS c1, ARRAY_AGG(c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_array_where AS SELECT
ARRAY_AGG(c1) FILTER(WHERE c1 < c2) AS f_c1, ARRAY_AGG(c2) FILTER(WHERE c1 < c2) AS f_c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_array_where_gby AS SELECT
id, ARRAY_AGG(c1) FILTER(WHERE c1 < c2) AS f_c1, ARRAY_AGG(c2) FILTER(WHERE c1 < c2) AS f_c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_count_col AS SELECT
COUNT(c1) AS c1, COUNT(c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_count_col_distinct AS SELECT
COUNT(DISTINCT c1) AS c1, COUNT(DISTINCT c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_count_col_distinct_gby AS SELECT
id, COUNT(DISTINCT c1) AS c1, COUNT(DISTINCT c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_count_col_gby AS SELECT
id, COUNT(c1) AS c1, COUNT(c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_count_col_where AS SELECT
COUNT(c1) FILTER(WHERE c1 < c2) AS c1, COUNT(c2) FILTER(WHERE c1 < c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_count_col_where_gby AS SELECT
id, COUNT(c1) FILTER(WHERE c1 < c2) AS c1, COUNT(c2) FILTER(WHERE c1 < c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_count AS SELECT
COUNT(*) AS count
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_count_gby AS SELECT
id, COUNT(*) AS count
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_count_where AS SELECT
COUNT(*) FILTER(WHERE c1 < c2) AS count
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_count_where_gby AS SELECT
id, COUNT(*) FILTER(WHERE c1 < c2) AS count
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_max_distinct AS SELECT
MAX(DISTINCT c1) AS c1, MAX(DISTINCT c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_max_distinct_gby AS SELECT
id, MAX(DISTINCT c1) AS c1, MAX(DISTINCT c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_max_gby AS SELECT
id, MAX(c1) AS c1, MAX(c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_max AS SELECT
MAX(c1) AS c1, MAX(c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_max_where AS SELECT
MAX(c1) FILTER(WHERE c1 < c2) AS c1, MAX(c2) FILTER(WHERE c1 < c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_max_where_gby AS SELECT
id, MAX(c1) FILTER(WHERE c1 < c2) AS c1, MAX(c2) FILTER(WHERE c1 < c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_min_distinct AS SELECT
MIN(DISTINCT c1) AS c1, MIN(DISTINCT c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_min_distinct_gby AS SELECT
id, MIN(DISTINCT c1) AS c1, MIN(DISTINCT c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_min_gby AS SELECT
id, MIN(c1) AS c1, MIN(c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_min AS SELECT
MIN(c1) AS c1, MIN(c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_min_where AS SELECT
MIN(c1) FILTER(WHERE c1 < c2) AS c1, MIN(c2) FILTER(WHERE c1 < c2) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_min_where_gby AS SELECT
id, MIN(c1) FILTER(WHERE c1 < c2) AS c1, MIN(c2) FILTER(WHERE c1 < c2) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_every AS SELECT
EVERY(c1 > c2) AS c1, EVERY(c2 > c1) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_every_distinct AS SELECT
EVERY(DISTINCT c1 > c2) AS c1, EVERY(DISTINCT c2 > c1) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_every_distinct_gby AS SELECT
id, EVERY(DISTINCT c1 > c2) AS c1, EVERY(DISTINCT c2 > c1) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_every_gby AS SELECT
id, EVERY(c1 > c2) AS c1, EVERY(c2 > c1) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_every_where AS SELECT
EVERY(c1 > c2) FILTER(WHERE c2 IS NOT NULL) AS c1, EVERY(c2 > c1) FILTER(WHERE c2 IS NOT NULL) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_every_where_gby AS SELECT
id, EVERY(c1 > c2) FILTER(WHERE c2 IS NOT NULL) AS c1, EVERY(c2 > c1) FILTER(WHERE c2 IS NOT NULL) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_some AS SELECT
SOME(c1 > c2) AS c1, SOME(c2 > c1) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_some_distinct AS SELECT
SOME(DISTINCT c1 > c2) AS c1, SOME(DISTINCT c2 > c1) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_some_distinct_gby AS SELECT
id, SOME(DISTINCT c1 > c2) AS c1, SOME(DISTINCT c2 > c1) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_some_gby AS SELECT
id, SOME(c1 > c2) AS c1, SOME(c2 > c1) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW varbinary_some_where AS SELECT
SOME(c1 > c2) FILTER(WHERE c2 IS NOT NULL) AS c1, SOME(c2 > c1) FILTER(WHERE c2 IS NOT NULL) AS c2
FROM varbinary_tbl;

CREATE MATERIALIZED VIEW varbinary_some_where_gby AS SELECT
id, SOME(c1 > c2) FILTER(WHERE c2 IS NOT NULL) AS c1, SOME(c2 > c1) FILTER(WHERE c2 IS NOT NULL) AS c2
FROM varbinary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_arg_max_distinct AS SELECT
ARG_MAX(DISTINCT c1, c2) AS c1, ARG_MAX(DISTINCT c2, c1) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_arg_max_distinct_gby AS SELECT
id, ARG_MAX(DISTINCT c1, c2) AS c1, ARG_MAX(DISTINCT c2, c1) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_arg_max_gby AS SELECT
id, ARG_MAX(c1, c2) AS c1, ARG_MAX(c2, c1) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_arg_max AS SELECT
ARG_MAX(c1, c2) AS c1, ARG_MAX(c2, c1) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_arg_max_where AS SELECT
ARG_MAX(c1, c2) FILTER(WHERE c1 < c2) AS c1, ARG_MAX(c2, c1) FILTER(WHERE c1 < c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_arg_max_where_gby AS SELECT
id, ARG_MAX(c1, c2) FILTER(WHERE c1 < c2) AS c1, ARG_MAX(c2, c1) FILTER(WHERE c1 < c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_arg_min_distinct AS SELECT
ARG_MIN(DISTINCT c1, c2) AS c1, ARG_MIN(DISTINCT c2, c1) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_arg_min_distinct_gby AS SELECT
id, ARG_MIN(DISTINCT c1, c2) AS c1, ARG_MIN(DISTINCT c2, c1) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_arg_min_gby AS SELECT
id, ARG_MIN(c1, c2) AS c1, ARG_MIN(c2, c1) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_arg_min AS SELECT
ARG_MIN(c1, c2) AS c1, ARG_MIN(c2, c1) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_arg_min_where AS SELECT
ARG_MIN(c1, c2) FILTER(WHERE c1 < c2) AS c1, ARG_MIN(c2, c1) FILTER(WHERE c1 < c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_arg_min_where_gby AS SELECT
id, ARG_MIN(c1, c2) FILTER(WHERE c1 < c2) AS c1, ARG_MIN(c2, c1) FILTER(WHERE c1 < c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_array_agg_distinct AS SELECT
ARRAY_AGG(DISTINCT c1) AS c1, ARRAY_AGG(DISTINCT c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_array_agg_distinct_gby AS SELECT
id, ARRAY_AGG(DISTINCT c1) AS c1, ARRAY_AGG(DISTINCT c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_array_agg_gby AS SELECT
id, ARRAY_AGG(c1) AS c1, ARRAY_AGG(c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_array_agg AS SELECT
ARRAY_AGG(c1) AS c1, ARRAY_AGG(c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_array_where AS SELECT
ARRAY_AGG(c1) FILTER(WHERE c1 < c2) AS f_c1, ARRAY_AGG(c2) FILTER(WHERE c1 < c2) AS f_c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_array_where_gby AS SELECT
id, ARRAY_AGG(c1) FILTER(WHERE c1 < c2) AS f_c1, ARRAY_AGG(c2) FILTER(WHERE c1 < c2) AS f_c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_count_col AS SELECT
COUNT(c1) AS c1, COUNT(c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_count_col_distinct AS SELECT
COUNT(DISTINCT c1) AS c1, COUNT(DISTINCT c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_count_col_distinct_gby AS SELECT
id, COUNT(DISTINCT c1) AS c1, COUNT(DISTINCT c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_count_col_gby AS SELECT
id, COUNT(c1) AS c1, COUNT(c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_count_col_where AS SELECT
COUNT(c1) FILTER(WHERE c1 < c2) AS c1, COUNT(c2) FILTER(WHERE c1 < c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_count_col_where_gby AS SELECT
id, COUNT(c1) FILTER(WHERE c1 < c2) AS c1, COUNT(c2) FILTER(WHERE c1 < c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_count AS SELECT
COUNT(*) AS count
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_count_gby AS SELECT
id, COUNT(*) AS count
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_count_where AS SELECT
COUNT(*) FILTER(WHERE c1 < c2) AS count
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_count_where_gby AS SELECT
id, COUNT(*) FILTER(WHERE c1 < c2) AS count
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_max_distinct AS SELECT
MAX(DISTINCT c1) AS c1, MAX(DISTINCT c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_max_distinct_gby AS SELECT
id, MAX(DISTINCT c1) AS c1, MAX(DISTINCT c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_max_gby AS SELECT
id, MAX(c1) AS c1, MAX(c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_max AS SELECT
MAX(c1) AS c1, MAX(c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_max_where AS SELECT
MAX(c1) FILTER(WHERE c1 < c2) AS c1, MAX(c2) FILTER(WHERE c1 < c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_max_where_gby AS SELECT
id, MAX(c1) FILTER(WHERE c1 < c2) AS c1, MAX(c2) FILTER(WHERE c1 < c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_min_distinct AS SELECT
MIN(DISTINCT c1) AS c1, MIN(DISTINCT c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_min_distinct_gby AS SELECT
id, MIN(DISTINCT c1) AS c1, MIN(DISTINCT c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_min_gby AS SELECT
id, MIN(c1) AS c1, MIN(c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_min AS SELECT
MIN(c1) AS c1, MIN(c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_min_where AS SELECT
MIN(c1) FILTER(WHERE c1 < c2) AS c1, MIN(c2) FILTER(WHERE c1 < c2) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_min_where_gby AS SELECT
id, MIN(c1) FILTER(WHERE c1 < c2) AS c1, MIN(c2) FILTER(WHERE c1 < c2) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_every AS SELECT
EVERY(c1 > c2) AS c1, EVERY(c2 > c1) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_every_distinct AS SELECT
EVERY(DISTINCT c1 > c2) AS c1, EVERY(DISTINCT c2 > c1) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_every_distinct_gby AS SELECT
id, EVERY(DISTINCT c1 > c2) AS c1, EVERY(DISTINCT c2 > c1) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_every_gby AS SELECT
id, EVERY(c1 > c2) AS c1, EVERY(c2 > c1) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_every_where AS SELECT
EVERY(c1 > c2) FILTER(WHERE c2 IS NOT NULL) AS c1, EVERY(c2 > c1) FILTER(WHERE c2 IS NOT NULL) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_every_where_gby AS SELECT
id, EVERY(c1 > c2) FILTER(WHERE c2 IS NOT NULL) AS c1, EVERY(c2 > c1) FILTER(WHERE c2 IS NOT NULL) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_some AS SELECT
SOME(c1 > c2) AS c1, SOME(c2 > c1) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_some_distinct AS SELECT
SOME(DISTINCT c1 > c2) AS c1, SOME(DISTINCT c2 > c1) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_some_distinct_gby AS SELECT
id, SOME(DISTINCT c1 > c2) AS c1, SOME(DISTINCT c2 > c1) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_some_gby AS SELECT
id, SOME(c1 > c2) AS c1, SOME(c2 > c1) AS c2
FROM binary_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW binary_some_where AS SELECT
SOME(c1 > c2) FILTER(WHERE c2 IS NOT NULL) AS c1, SOME(c2 > c1) FILTER(WHERE c2 IS NOT NULL) AS c2
FROM binary_tbl;

CREATE MATERIALIZED VIEW binary_some_where_gby AS SELECT
id, SOME(c1 > c2) FILTER(WHERE c2 IS NOT NULL) AS c1, SOME(c2 > c1) FILTER(WHERE c2 IS NOT NULL) AS c2
FROM binary_tbl
GROUP BY id;
