CREATE TABLE decimal_tbl(
id INT, c1 DECIMAL(6,2), c2 DECIMAL(6,2) NOT NULL
);

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

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

CREATE TABLE int_tbl(
id INT, c1 INT, c2 INT NOT NULL);

CREATE TABLE row_tbl(
id INT,
c1 INT NOT NULL,
c2 VARCHAR,
c3 VARCHAR);

CREATE TABLE real_tbl(
id INT,
c1 REAL,
c2 REAL NOT NULL);;


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

CREATE MATERIALIZED VIEW int_arg_max_diff 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 int0_tbl;

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

CREATE MATERIALIZED VIEW int_arg_max_distinct_diff 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 int0_tbl;

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

CREATE MATERIALIZED VIEW int_arg_max_distinct_gby_diff 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 int0_tbl
GROUP BY id;

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

CREATE MATERIALIZED VIEW int_arg_max_gby_diff 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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_arg_gby_max_diff1 AS SELECT
id, ARG_MAX(c1+c2, c2-c1) AS c1, ARG_MAX(c2-c1, c1+c2) AS c2, ARG_MAX(c3%c4, c4%c3) AS c3, ARG_MAX(c4%c3, c3%c4) AS c4, ARG_MAX(c5*c6, c6/c5) AS c5, ARG_MAX(c6/c5, c5*c6) AS c6, ARG_MAX(c7+c8, c8-c7) AS c7, ARG_MAX(c8-c7, c7+c8) AS c8
FROM int0_tbl
GROUP BY id;

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

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

CREATE MATERIALIZED VIEW int_arg_max_where_diff1 AS SELECT
ARG_MAX(c1+c2, c2-c1) FILTER(WHERE c8>2) AS f_c1,
ARG_MAX(c2-c1, c1+c2) FILTER(WHERE c8>2) AS f_c2,
ARG_MAX(c3%c4, c4%c3) FILTER(WHERE c8>2) AS f_c3,
ARG_MAX(c4%c3, c3%c4) FILTER(WHERE c8>2) AS f_c4,
ARG_MAX(c5*c6, c6/c5) FILTER(WHERE c8>2) AS f_c5,
ARG_MAX(c6/c5, c5*c6) FILTER(WHERE c8>2) AS f_c6,
ARG_MAX(c7+c8, c8-c7) FILTER(WHERE c8>2) AS f_c7,
ARG_MAX(c8-c7, c7+c8) FILTER(WHERE c8>2) AS f_c8
FROM int0_tbl;

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

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

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

CREATE MATERIALIZED VIEW int_arg_min_diff 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 int0_tbl;

CREATE MATERIALIZED VIEW int_arg_min_diff1 AS SELECT
ARG_MIN(c1+c2, c2-c1) AS c1, ARG_MIN(c2-c1, c1+c2) AS c2, ARG_MIN(c3%c4, c4%c3) AS c3, ARG_MIN(c4%c3, c3%c4) AS c4, ARG_MIN(c5*c6, c6/c5) AS c5, ARG_MIN(c6/c5, c5*c6) AS c6, ARG_MIN(c7+c8, c8-c7) AS c7, ARG_MIN(c8-c7, c7+c8) AS c8
FROM int0_tbl;

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

CREATE MATERIALIZED VIEW int_arg_min_distinct_diff 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 int0_tbl;

CREATE MATERIALIZED VIEW int_arg_min_distinct_gby_diff 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 int0_tbl
GROUP BY id;

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

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

CREATE MATERIALIZED VIEW int_arg_min_gby_diff 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 int0_tbl
GROUP BY id;

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

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

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

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

CREATE MATERIALIZED VIEW int_arg_min_where_gby_diff1 AS SELECT
id,
ARG_MIN(c1+c2, c2-c1) FILTER(WHERE c8>2) AS f_c1,
ARG_MIN(c2-c1, c1+c2) FILTER(WHERE c8>2) AS f_c2,
ARG_MIN(c3%c4, c4%c3) FILTER(WHERE c8>2) AS f_c3,
ARG_MIN(c4%c3, c3%c4) FILTER(WHERE c8>2) AS f_c4,
ARG_MIN(c5*c6, c6/c5) FILTER(WHERE c8>2) AS f_c5,
ARG_MIN(c6/c5, c5*c6) FILTER(WHERE c8>2) AS f_c6,
ARG_MIN(c7+c8, c8-c7) FILTER(WHERE c8>2) AS f_c7,
ARG_MIN(c8-c7, c7+c8) FILTER(WHERE c8>2) AS f_c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW 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 int0_tbl;

CREATE MATERIALIZED VIEW 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 int0_tbl;

CREATE MATERIALIZED VIEW 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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW 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 int0_tbl
GROUP BY id;

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

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

CREATE MATERIALIZED VIEW int_bit_and AS SELECT
BIT_AND(c1) AS c1, BIT_AND(c2) AS c2, BIT_AND(c3) AS c3, BIT_AND(c4) AS c4, BIT_AND(c5) AS c5, BIT_AND(c6) AS c6, BIT_AND(c7) AS c7, BIT_AND(c8) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_bit_and_distinct AS SELECT
BIT_AND(DISTINCT c1) AS c1, BIT_AND(DISTINCT c2) AS c2, BIT_AND(DISTINCT c3) AS c3, BIT_AND(DISTINCT c4) AS c4, BIT_AND(DISTINCT c5) AS c5, BIT_AND(DISTINCT c6) AS c6, BIT_AND(DISTINCT c7) AS c7, BIT_AND(DISTINCT c8) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_bit_and_distinct_groupby AS SELECT
id, BIT_AND(DISTINCT c1) AS c1, BIT_AND(DISTINCT c2) AS c2, BIT_AND(DISTINCT c3) AS c3, BIT_AND(DISTINCT c4) AS c4, BIT_AND(DISTINCT c5) AS c5, BIT_AND(DISTINCT c6) AS c6, BIT_AND(DISTINCT c7) AS c7, BIT_AND(DISTINCT c8) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_bit_and_groupby AS SELECT
id, BIT_AND(c1) AS c1, BIT_AND(c2) AS c2, BIT_AND(c3) AS c3, BIT_AND(c4) AS c4, BIT_AND(c5) AS c5, BIT_AND(c6) AS c6, BIT_AND(c7) AS c7, BIT_AND(c8) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_bit_and_where AS SELECT
BIT_AND(c1) FILTER(WHERE c8>2) AS f_c1, BIT_AND(c2) FILTER(WHERE c8>2) AS f_c2, BIT_AND(c3) FILTER(WHERE c8>2) AS f_c3, BIT_AND(c4) FILTER(WHERE c8>2) AS f_c4, BIT_AND(c5) FILTER(WHERE c8>2) AS f_c5, BIT_AND(c6) FILTER(WHERE c8>2) AS f_c6, BIT_AND(c7) FILTER(WHERE c8>2) AS f_c7, BIT_AND(c8) FILTER(WHERE c8>2) AS f_c8
FROM int0_tbl;

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

CREATE MATERIALIZED VIEW int_bit_or AS SELECT
BIT_OR(c1) AS c1, BIT_OR(c2) AS c2, BIT_OR(c3) AS c3, BIT_OR(c4) AS c4, BIT_OR(c5) AS c5, BIT_OR(c6) AS c6, BIT_OR(c7) AS c7, BIT_OR(c8) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_bit_or_distinct AS SELECT
BIT_OR(DISTINCT c1) AS c1, BIT_OR(DISTINCT c2) AS c2, BIT_OR(DISTINCT c3) AS c3, BIT_OR(DISTINCT c4) AS c4, BIT_OR(DISTINCT c5) AS c5, BIT_OR(DISTINCT c6) AS c6, BIT_OR(DISTINCT c7) AS c7, BIT_OR(DISTINCT c8) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_bit_or_distinct_gby AS SELECT
id, BIT_OR(DISTINCT c1) AS c1, BIT_OR(DISTINCT c2) AS c2, BIT_OR(DISTINCT c3) AS c3, BIT_OR(DISTINCT c4) AS c4, BIT_OR(DISTINCT c5) AS c5, BIT_OR(DISTINCT c6) AS c6, BIT_OR(DISTINCT c7) AS c7, BIT_OR(DISTINCT c8) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_bit_or_gby AS
SELECT id, BIT_OR(c1) AS c1, BIT_OR(c2) AS c2, BIT_OR(c3) AS c3, BIT_OR(c4) AS c4, BIT_OR(c5) AS c5, BIT_OR(c6) AS c6, BIT_OR(c7) AS c7, BIT_OR(c8) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_bit_or_where AS SELECT
BIT_OR(c1) FILTER(WHERE c8>2) AS f_c1, BIT_OR(c2) FILTER(WHERE c8>2) AS f_c2, BIT_OR(c3) FILTER(WHERE c8>2) AS f_c3, BIT_OR(c4) FILTER(WHERE c8>2) AS f_c4, BIT_OR(c5) FILTER(WHERE c8>2) AS f_c5, BIT_OR(c6) FILTER(WHERE c8>2) AS f_c6, BIT_OR(c7) FILTER(WHERE c8>2) AS f_c7, BIT_OR(c8) FILTER(WHERE c8>2) AS f_c8
FROM int0_tbl;

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

CREATE MATERIALIZED VIEW int_bit_xor_view AS SELECT
BIT_XOR(c1) AS c1, BIT_XOR(c2) AS c2, BIT_XOR(c3) AS c3, BIT_XOR(c4) AS c4, BIT_XOR(c5) AS c5, BIT_XOR(c6) AS c6, BIT_XOR(c7) AS c7, BIT_XOR(c8) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_bit_xor_gby AS SELECT
id, BIT_XOR(c1) AS c1, BIT_XOR(c2) AS c2, BIT_XOR(c3) AS c3, BIT_XOR(c4) AS c4, BIT_XOR(c5) AS c5, BIT_XOR(c6) AS c6, BIT_XOR(c7) AS c7, BIT_XOR(c8) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_bit_xor_distinct AS SELECT
BIT_XOR(DISTINCT c1) AS c1, BIT_XOR(DISTINCT c2) AS c2, BIT_XOR(DISTINCT c3) AS c3, BIT_XOR(DISTINCT c4) AS c4, BIT_XOR(DISTINCT c5) AS c5, BIT_XOR(DISTINCT c6) AS c6, BIT_XOR(DISTINCT c7) AS c7, BIT_XOR(DISTINCT c8) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_bit_xor_distinct_gby AS SELECT
id, BIT_XOR(DISTINCT c1) AS c1, BIT_XOR(DISTINCT c2) AS c2, BIT_XOR(DISTINCT c3) AS c3, BIT_XOR(DISTINCT c4) AS c4, BIT_XOR(DISTINCT c5) AS c5, BIT_XOR(DISTINCT c6) AS c6, BIT_XOR(DISTINCT c7) AS c7, BIT_XOR(DISTINCT c8) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_bit_xor_where AS SELECT
BIT_XOR(c1) FILTER(WHERE c8>2) AS f_c1, BIT_XOR(c2) FILTER(WHERE c8>2) AS f_c2, BIT_XOR(c3) FILTER(WHERE c8>2) AS f_c3, BIT_XOR(c4) FILTER(WHERE c8>2) AS f_c4, BIT_XOR(c5) FILTER(WHERE c8>2) AS f_c5, BIT_XOR(c6) FILTER(WHERE c8>2) AS f_c6, BIT_XOR(c7) FILTER(WHERE c8>2) AS f_c7, BIT_XOR(c8) FILTER(WHERE c8>2) AS f_c8
FROM int0_tbl;

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

CREATE MATERIALIZED VIEW int_count AS SELECT
COUNT(*) AS count
FROM int0_tbl;

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

CREATE MATERIALIZED VIEW int_count_where AS SELECT
COUNT(*) FILTER(WHERE (c5+C6)> 3) AS count
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_count_where_gby AS SELECT
id, COUNT(*) FILTER(WHERE (c5+C6)> 3) AS count
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW 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 int0_tbl;

CREATE MATERIALIZED VIEW 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 int0_tbl;

CREATE MATERIALIZED VIEW 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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW 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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_count_col_where AS SELECT
COUNT(c1) FILTER(WHERE (c5+C6)> 3) AS f_c1, COUNT(c2) FILTER(WHERE (c5+C6)> 3) AS f_c2, COUNT(c3) FILTER(WHERE (c5+C6)> 3) AS f_c3, COUNT(c4) FILTER(WHERE (c5+C6)> 3) AS f_c4, COUNT(c5) FILTER(WHERE (c5+C6)> 3) AS f_c5, COUNT(c6) FILTER(WHERE (c5+C6)> 3) AS f_c6, COUNT(c7) FILTER(WHERE (c5+C6)> 3) AS f_c7, COUNT(c8) FILTER(WHERE (c5+C6)> 3) AS f_c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_count_col_where_gbt AS SELECT
id, COUNT(c1) FILTER(WHERE (c5+C6)> 3) AS f_c1, COUNT(c2) FILTER(WHERE (c5+C6)> 3) AS f_c2, COUNT(c3) FILTER(WHERE (c5+C6)> 3) AS f_c3, COUNT(c4) FILTER(WHERE (c5+C6)> 3) AS f_c4, COUNT(c5) FILTER(WHERE (c5+C6)> 3) AS f_c5, COUNT(c6) FILTER(WHERE (c5+C6)> 3) AS f_c6, COUNT(c7) FILTER(WHERE (c5+C6)> 3) AS f_c7, COUNT(c8) FILTER(WHERE (c5+C6)> 3) AS f_c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_arg_min_distinct AS SELECT
ARG_MIN(DISTINCT c1, c2) AS c1,
ARG_MIN(DISTINCT c2, c1) AS c2
FROM decimal_tbl;

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

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

CREATE MATERIALIZED VIEW decimal_arg_min AS SELECT
ARG_MIN(c1, c2) AS c1,
ARG_MIN(c2, c1) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_arg_min_where AS SELECT
ARG_MIN(c1, c2) FILTER(WHERE c2!= 2231.90) AS c1,
ARG_MIN(c2, c1) FILTER(WHERE c2!= 2231.90) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_arg_min_where_gby AS SELECT
id,
ARG_MIN(c1, c2) FILTER(WHERE c2!= 2231.90) AS c1,
ARG_MIN(c2, c1) FILTER(WHERE c2!= 2231.90) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_arg_max_distinct AS SELECT
ARG_MAX(DISTINCT c1, c2) AS c1,
ARG_MAX(DISTINCT c2, c1) AS c2
FROM decimal_tbl;

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

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

CREATE MATERIALIZED VIEW decimal_arg_max AS SELECT
ARG_MAX(c1, c2) AS c1,
ARG_MAX(c2, c1) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_arg_max_where AS SELECT
ARG_MAX(c1, c2) FILTER(WHERE c2!= 7689.88) AS c1,
ARG_MAX(c2, c1) FILTER(WHERE c2!= 7689.88) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_arg_max_where_gby AS SELECT
id,
ARG_MAX(c1, c2) FILTER(WHERE c2!= 7689.88) AS c1,
ARG_MAX(c2, c1) FILTER(WHERE c2!= 7689.88) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_array_agg_distinct AS SELECT
ARRAY_AGG(DISTINCT c1) AS c1, ARRAY_AGG(DISTINCT c2) AS c2
FROM decimal_tbl;

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

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

CREATE MATERIALIZED VIEW decimal_array_agg AS SELECT
ARRAY_AGG(c1) AS c1, ARRAY_AGG(c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_array_where AS SELECT
ARRAY_AGG(c1) FILTER(WHERE c2 > 2231.90) AS f_c1, ARRAY_AGG(c2) FILTER(WHERE c2 > 2231.90) AS f_c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_array_where_gby AS SELECT
id, ARRAY_AGG(c1) FILTER(WHERE c2 > 2231.90) AS f_c1, ARRAY_AGG(c2) FILTER(WHERE c2 > 2231.90) AS f_c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_avg AS
SELECT AVG(c1) AS c1, AVG(c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_avg_distinct AS SELECT
AVG(DISTINCT c1) AS c1, AVG(DISTINCT c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_avg_distinct_gby AS SELECT
id, AVG(DISTINCT c1) AS c1, AVG(DISTINCT c2) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_avg_gby AS SELECT
id, AVG(c1) AS c1, AVG(c2) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_avg_where AS SELECT
AVG(c1) FILTER(WHERE c2>2231.90) AS f_c1, AVG(c2) FILTER(WHERE c2>2231.90) AS f_c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_avg_where_gby AS SELECT
id, AVG(c1) FILTER(WHERE c2>2231.90) AS f_c1, AVG(c2) FILTER(WHERE c2>2231.90) AS f_c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_count AS SELECT
COUNT(*) AS count
FROM decimal_tbl;

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

CREATE MATERIALIZED VIEW decimal_count_where AS SELECT
COUNT(*) FILTER(WHERE c2!= 2231.90) AS count
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_count_where_gby AS SELECT
id, COUNT(*) FILTER(WHERE c2!= 2231.90) AS count
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_count_col AS SELECT
COUNT(c1) AS c1, COUNT(c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_count_col_distinct AS SELECT
COUNT(DISTINCT c1) AS c1, COUNT(DISTINCT c2) AS c2
FROM decimal_tbl;

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

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

CREATE MATERIALIZED VIEW decimal_count_col_where AS SELECT
COUNT(c1) FILTER(WHERE c2!= 2231.90) AS c1,
COUNT(c2) FILTER(WHERE c2!= 2231.90) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_count_col_where_gby AS SELECT
id,
COUNT(c1) FILTER(WHERE c2!= 2231.90) AS c1,
COUNT(c2) FILTER(WHERE c2!= 2231.90) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_max_distinct AS SELECT
MAX(DISTINCT c1) AS c1,
MAX(DISTINCT c2) AS c2
FROM decimal_tbl;

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

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

CREATE MATERIALIZED VIEW decimal_max AS SELECT
MAX(c1) AS c1,
MAX(c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_max_where AS SELECT
MAX(c1) FILTER (WHERE c2!= 7689.88) AS f_c1,
MAX(c2) FILTER (WHERE c2!= 7689.88) AS f_c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_max_where_gby AS SELECT
id,
MAX(c1) FILTER (WHERE c2!= 7689.88) AS f_c1,
MAX(c2) FILTER (WHERE c2!= 7689.88) AS f_c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_min_distinct AS SELECT
MIN(DISTINCT c1) AS c1,
MIN(DISTINCT c2) AS c2
FROM decimal_tbl;

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

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

CREATE MATERIALIZED VIEW decimal_min AS SELECT
MIN(c1) AS c1,
MIN(c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_min_where AS SELECT
MIN(c1) FILTER (WHERE c2!= 2231.90) AS f_c1,
MIN(c2) FILTER (WHERE c2!= 2231.90) AS f_c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_min_where_gby AS SELECT
id,
MIN(c1) FILTER (WHERE c2!= 2231.90) AS f_c1,
MIN(c2) FILTER (WHERE c2!= 2231.90) AS f_c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_every AS SELECT
EVERY(c1 > 1111.52) AS c1, EVERY(c2 > 3802.71) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_every_distinct AS SELECT
EVERY(DISTINCT c1 > 1111.52) AS c1, EVERY(DISTINCT c2 > 3802.71) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_every_distinct_gby AS SELECT
id, EVERY(DISTINCT c1 > 1111.52) AS c1, EVERY(DISTINCT c2 > 3802.71) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_every_gby AS SELECT
id, EVERY(c1 > 1111.52) AS c1, EVERY(c2 > 3802.71) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_every_where AS SELECT
EVERY(c1 > 1111.52) FILTER(WHERE c1 IS NOT NULL) AS c1,
EVERY(c2 > 3802.71) FILTER(WHERE c1 IS NOT NULL) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_every_where_gby AS SELECT
id,
EVERY(c1 > 1111.52) FILTER(WHERE c1 IS NOT NULL) AS c1,
EVERY(c2 > 3802.71) FILTER(WHERE c1 IS NOT NULL) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_some AS SELECT
SOME(c1 > 1111.52) AS c1, SOME(c2 > 3802.71) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_some_distinct AS SELECT
SOME(DISTINCT c1 > 1111.52) AS c1, SOME(DISTINCT c2 > 3802.71) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_some_distinct_gby AS SELECT
id, SOME(DISTINCT c1 > 1111.52) AS c1, SOME(DISTINCT c2 > 3802.71) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_some_gby AS SELECT
id, SOME(c1 > 1111.52) AS c1, SOME(c2 > 3802.71) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_some_where AS SELECT
SOME(c1 > 1111.52) FILTER(WHERE c1 IS NOT NULL) AS c1,
SOME(c2 > 3802.71) FILTER(WHERE c1 IS NOT NULL) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_some_where_gby AS SELECT
id,
SOME(c1 > 1111.52) FILTER(WHERE c1 IS NOT NULL) AS c1,
SOME(c2 > 3802.71) FILTER(WHERE c1 IS NOT NULL) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_sum AS SELECT
SUM(c1) AS c1, SUM(c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_sum_distinct AS SELECT
SUM(DISTINCT c1) AS c1, SUM(DISTINCT c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_sum_distinct_gby AS SELECT
id, SUM(DISTINCT c1) AS c1, SUM(DISTINCT c2) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_sum_gby AS SELECT
id, SUM(c1) AS c1, SUM(c2) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_sum_where AS SELECT
SUM(c1) FILTER(WHERE c2>2231.90) AS f_c1, SUM(c2) FILTER(WHERE c2>2231.90) AS f_c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_sum_where_gby AS SELECT
id, SUM(c1) FILTER(WHERE c2>2231.90) AS f_c1, SUM(c2) FILTER(WHERE c2>2231.90) AS f_c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_stddev_samp AS SELECT
STDDEV_SAMP(c1) AS c1,
STDDEV_SAMP(c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_stddev_samp_distinct AS SELECT
STDDEV_SAMP(DISTINCT c1) AS c1,
STDDEV_SAMP(DISTINCT c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_stddev_samp_distinct_gby AS SELECT
id,
STDDEV_SAMP(DISTINCT c1) AS c1,
STDDEV_SAMP(DISTINCT c2) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_stddev_samp_gby AS SELECT
id,
STDDEV_SAMP(c1) AS c1,
STDDEV_SAMP(c2) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_stddev_where AS SELECT
STDDEV_SAMP(c1) FILTER (WHERE c2 > 2231.90) AS c1,
STDDEV_SAMP(c2) FILTER (WHERE c2 > 2231.90) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_stddev_where_gby AS SELECT
id,
STDDEV_SAMP(c1) FILTER (WHERE c2 > 2231.90) AS c1,
STDDEV_SAMP(c2) FILTER (WHERE c2 > 2231.90) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_stddev_pop AS SELECT
STDDEV_POP(c1) AS c1,
STDDEV_POP(c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_stddev_pop_distinct AS SELECT
STDDEV_POP(DISTINCT c1) AS c1,
STDDEV_POP(DISTINCT c2) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_stddev_pop_distinct_gby AS SELECT
id,
STDDEV_POP(DISTINCT c1) AS c1,
STDDEV_POP(DISTINCT c2) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_stddev_pop_gby AS SELECT
id,
STDDEV_POP(c1) AS c1,
STDDEV_POP(c2) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW decimal_stddev_pop_where AS SELECT
STDDEV_POP(c1) FILTER (WHERE c2 > 2231.90) AS c1,
STDDEV_POP(c2) FILTER (WHERE c2 > 2231.90) AS c2
FROM decimal_tbl;

CREATE MATERIALIZED VIEW decimal_stddev_pop_where_gby AS SELECT
id,
STDDEV_POP(c1) FILTER (WHERE c2 > 2231.90) AS c1,
STDDEV_POP(c2) FILTER (WHERE c2 > 2231.90) AS c2
FROM decimal_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_every_value AS SELECT
EVERY(c1 = 4) AS c1, EVERY(c2 > 1) AS c2, EVERY(c3>3) AS c3, EVERY(c4>1) AS c4, EVERY(c5>1) AS c5, EVERY(c6 % 2 = 1) AS c6, EVERY(c7>2) AS c7, EVERY(c8>2) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_every_distinct AS SELECT
EVERY(DISTINCT(c1 = 4)) AS c1, EVERY(DISTINCT(c2 > 1)) AS c2, EVERY(DISTINCT(c3>3)) AS c3, EVERY(DISTINCT(c4>1)) AS c4, EVERY(DISTINCT(c5>1)) AS c5, EVERY(DISTINCT(c6 % 2 = 1)) AS c6, EVERY(DISTINCT(c7>2)) AS c7, EVERY(DISTINCT(c8>2)) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_every_distinct_gby AS SELECT
id, EVERY(DISTINCT(c1 = 4)) AS c1, EVERY(DISTINCT(c2 > 1)) AS c2, EVERY(DISTINCT(c3>3)) AS c3, EVERY(DISTINCT(c4>1)) AS c4, EVERY(DISTINCT(c5>1)) AS c5, EVERY(DISTINCT(c6 % 2 = 1)) AS c6, EVERY(DISTINCT(c7>2)) AS c7, EVERY(DISTINCT(c8>2)) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_every_gby AS SELECT
id, EVERY(c1 = 4) AS c1, EVERY(c2 > 1) AS c2, EVERY(c3>3) AS c3, EVERY(c4>1) AS c4, EVERY(c5>1) AS c5, EVERY(c6 % 2 = 1) AS c6, EVERY(c7>2) AS c7, EVERY(c8>2) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_every_where AS SELECT
EVERY(c1 = 4) FILTER (WHERE c1 > 0) AS c1, EVERY(c2 > 1) FILTER (WHERE c1 > 0) AS c2, EVERY(c3 > 3) FILTER (WHERE c1 > 0) AS c3, EVERY(c4 > 1) FILTER (WHERE c1 > 0) AS c4, EVERY(c5 > 1) FILTER (WHERE c1 > 0) AS c5, EVERY(c6 % 2 = 1) FILTER (WHERE c1 > 0) AS c6, EVERY(c7 > 2) FILTER (WHERE c1 > 0) AS c7, EVERY(c8 > 2) FILTER (WHERE c1 > 0) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_every_where_gby AS SELECT
id, EVERY(c1 = 4) FILTER (WHERE c1 > 0) AS c1, EVERY(c2 > 1) FILTER (WHERE c1 > 0) AS c2, EVERY(c3 > 3) FILTER (WHERE c1 > 0) AS c3, EVERY(c4 > 1) FILTER (WHERE c1 > 0) AS c4, EVERY(c5 > 1) FILTER (WHERE c1 > 0) AS c5, EVERY(c6 % 2 = 1) FILTER (WHERE c1 > 0) AS c6, EVERY(c7 > 2) FILTER (WHERE c1 > 0) AS c7, EVERY(c8 > 2) FILTER (WHERE c1 > 0) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_max_view 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 int0_tbl;

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

CREATE MATERIALIZED VIEW 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 int0_tbl;

CREATE MATERIALIZED VIEW int_max_distinct_gbt 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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW 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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_max_where AS SELECT
MAX(c1) FILTER(WHERE c5 + C6>3) AS f_c1, MAX(c2) FILTER(WHERE c5 + C6>3) AS f_c2, MAX(c3) FILTER(WHERE c5 + C6>3) AS f_c3, MAX(c4) FILTER(WHERE c5 + C6>3) AS f_c4, MAX(c5) FILTER(WHERE c5 + C6>3) AS f_c5, MAX(c6) FILTER(WHERE c5 + C6>3) AS f_c6,  MAX(c7) FILTER(WHERE c5 + C6>3) AS f_c7,  MAX(c8) FILTER(WHERE c5 + C6>3) AS f_c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_min_view 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 int0_tbl;

CREATE MATERIALIZED VIEW 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 int0_tbl;

CREATE MATERIALIZED VIEW 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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW 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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_min_where AS SELECT
MIN(c1) FILTER(WHERE c5 + C6>3) AS f_c1, MIN(c2) FILTER(WHERE c5 + C6>3) AS f_c2, MIN(c3) FILTER(WHERE c5 + C6>3) AS f_c3, MIN(c4) FILTER(WHERE c5 + C6>3) AS f_c4, MIN(c5) FILTER(WHERE c5 + C6>3) AS f_c5, MIN(c6) FILTER(WHERE c5 + C6>3) AS f_c6,  MIN(c7) FILTER(WHERE c5 + C6>3) AS f_c7,  MIN(c8) FILTER(WHERE c5 + C6>3) AS f_c8
FROM int0_tbl;

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

CREATE MATERIALIZED VIEW int_some AS SELECT
SOME(c1 = 4) AS c1, SOME(c2 > 1) AS c2, SOME(c3>3) AS c3, SOME(c4>1) AS c4, SOME(c5>1) AS c5, SOME(c6 % 2 = 1) AS c6, SOME(c7>2) AS c7, SOME(c8>2) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_some_distinct AS SELECT
SOME(DISTINCT(c1 = 4)) AS c1, SOME(DISTINCT(c2 > 1)) AS c2, SOME(DISTINCT(c3>3)) AS c3, SOME(DISTINCT(c4>1)) AS c4, SOME(DISTINCT(c5>1)) AS c5, SOME(DISTINCT(c6 % 2 = 1)) AS c6, SOME(DISTINCT(c7>2)) AS c7, SOME(DISTINCT(c8>2)) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_some_distinct_gby AS SELECT
id, SOME(DISTINCT(c1 = 4)) AS c1, SOME(DISTINCT(c2 > 1)) AS c2, SOME(DISTINCT(c3>3)) AS c3, SOME(DISTINCT(c4>1)) AS c4, SOME(DISTINCT(c5>1)) AS c5, SOME(DISTINCT(c6 % 2 = 1)) AS c6, SOME(DISTINCT(c7>2)) AS c7, SOME(DISTINCT(c8>2)) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_some_gby AS SELECT
id, SOME(c1 = 4) AS c1, SOME(c2 > 1) AS c2, SOME(c3>3) AS c3, SOME(c4>1) AS c4, SOME(c5>1) AS c5, SOME(c6 % 2 = 1) AS c6, SOME(c7>2) AS c7, SOME(c8>2) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_some_where AS SELECT
SOME(c1 = 4) FILTER (WHERE c1 > 0) AS c1, SOME(c2 > 1) FILTER (WHERE c1 > 0) AS c2, SOME(c3 > 3) FILTER (WHERE c1 > 0) AS c3, SOME(c4 > 1) FILTER (WHERE c1 > 0) AS c4, SOME(c5 > 1) FILTER (WHERE c1 > 0) AS c5, SOME(c6 % 2 = 1) FILTER (WHERE c1 > 0) AS c6, SOME(c7 > 2) FILTER (WHERE c1 > 0) AS c7, SOME(c8 > 2) FILTER (WHERE c1 > 0) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_some_where_gby AS SELECT
id, SOME(c1 = 4) FILTER (WHERE c1 > 0) AS c1, SOME(c2 > 1) FILTER (WHERE c1 > 0) AS c2, SOME(c3 > 3) FILTER (WHERE c1 > 0) AS c3, SOME(c4 > 1) FILTER (WHERE c1 > 0) AS c4, SOME(c5 > 1) FILTER (WHERE c1 > 0) AS c5, SOME(c6 % 2 = 1) FILTER (WHERE c1 > 0) AS c6, SOME(c7 > 2) FILTER (WHERE c1 > 0) AS c7, SOME(c8 > 2) FILTER (WHERE c1 > 0) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW 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 stddev_tbl;

CREATE MATERIALIZED VIEW int_stddev_pop_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 int0_tbl;

CREATE MATERIALIZED VIEW 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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW 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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_stddev_pop_where AS SELECT
STDDEV_POP(c1) FILTER (WHERE c8>2) AS c1, STDDEV_POP(c2) FILTER (WHERE c8>2) AS c2, STDDEV_POP(c3) FILTER (WHERE c8>2) AS c3, STDDEV_POP(c4) FILTER (WHERE c8>2) AS c4, STDDEV_POP(c5) FILTER (WHERE c8>2) AS c5, STDDEV_POP(c6) FILTER (WHERE c8>2) AS c6, STDDEV_POP(c7) FILTER (WHERE c8>2) AS c7, STDDEV_POP(c8) FILTER (WHERE c8>2) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_stddev_pop_where_gby AS SELECT
id, STDDEV_POP(c1) FILTER (WHERE c8>2) AS c1, STDDEV_POP(c2) FILTER (WHERE c8>2) AS c2, STDDEV_POP(c3) FILTER (WHERE c8>2) AS c3, STDDEV_POP(c4) FILTER (WHERE c8>2) AS c4, STDDEV_POP(c5) FILTER (WHERE c8>2) AS c5, STDDEV_POP(c6) FILTER (WHERE c8>2) AS c6, STDDEV_POP(c7) FILTER (WHERE c8>2) AS c7, STDDEV_POP(c8) FILTER (WHERE c8>2) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_stddev_samp 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 stddev_tbl;

CREATE MATERIALIZED VIEW int_stddev_samp_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 int0_tbl;

CREATE MATERIALIZED VIEW int_stddev_samp_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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_stddev_samp_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 int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW int_stddev_where AS SELECT
STDDEV_SAMP(c1) FILTER (WHERE c1 > 0) AS c1, STDDEV_SAMP(c2) FILTER (WHERE c1 > 0) AS c2, STDDEV_SAMP(c3) FILTER (WHERE c1 > 0) AS c3, STDDEV_SAMP(c4) FILTER (WHERE c1 > 0) AS c4, STDDEV_SAMP(c5) FILTER (WHERE c1 > 0) AS c5, STDDEV_SAMP(c6) FILTER (WHERE c1 > 0) AS c6, STDDEV_SAMP(c7) FILTER (WHERE c1 > 0) AS c7, STDDEV_SAMP(c8) FILTER (WHERE c1 > 0) AS c8
FROM int0_tbl;

CREATE MATERIALIZED VIEW int_stddev_where_gby1 AS SELECT
id, STDDEV_SAMP(c1) FILTER (WHERE c8>2) AS c1, STDDEV_SAMP(c2) FILTER (WHERE c8>2) AS c2, STDDEV_SAMP(c3) FILTER (WHERE c8>2) AS c3, STDDEV_SAMP(c4) FILTER (WHERE c8>2) AS c4, STDDEV_SAMP(c5) FILTER (WHERE c8>2) AS c5, STDDEV_SAMP(c6) FILTER (WHERE c8>2) AS c6, STDDEV_SAMP(c7) FILTER (WHERE c8>2) AS c7, STDDEV_SAMP(c8) FILTER (WHERE c8>2) AS c8
FROM int0_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_arg_max_distinct AS SELECT
ARG_MAX(DISTINCT ROW(c1, c2, c3), c2) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_arg_max_distinct_gby AS SELECT
id, ARG_MAX(DISTINCT ROW(c1, c2, c3), c2) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_arg_max_gby AS SELECT
id, ARG_MAX(ROW(c1, c2, c3), c2) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_arg_max AS SELECT
ARG_MAX(ROW(c1, c2, c3), c2) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_arg_max_where AS SELECT
ARG_MAX(ROW(c1, c2, c3), c2) FILTER(WHERE c2 < c3) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_arg_max_where_gby AS SELECT
id, ARG_MAX(ROW(c1, c2, c3), c2) FILTER(WHERE c2 < c3) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_arg_min_distinct AS SELECT
ARG_MIN(DISTINCT ROW(c1, c2, c3), c2) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_arg_min_distinct_gby AS SELECT
id, ARG_MIN(DISTINCT ROW(c1, c2, c3), c2) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_arg_min_gby AS SELECT
id, ARG_MIN(ROW(c1, c2, c3), c2) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_arg_min AS SELECT
ARG_MIN(ROW(c1, c2, c3), c2) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_arg_min_where AS SELECT
ARG_MIN(ROW(c1, c2, c3), c2) FILTER(WHERE c2 < c3) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_arg_min_where_gby AS SELECT
id, ARG_MIN(ROW(c1, c2, c3), c2) FILTER(WHERE c2 < c3) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW time_row_agg_distinct AS SELECT
ARRAY_AGG(DISTINCT ROW(c2, c3)) AS c1, ARRAY_AGG(DISTINCT c1) AS c2
FROM row_tbl;

CREATE MATERIALIZED VIEW row_array_agg_distinct_gby AS SELECT
id, ARRAY_AGG(DISTINCT ROW(c2, c3)) AS c1, ARRAY_AGG(DISTINCT c1) AS c2
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_array_agg_gby AS SELECT
id, ARRAY_AGG(ROW(c2, c3)) AS c1, ARRAY_AGG(c1) AS c2
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_array_agg AS SELECT
ARRAY_AGG(ROW(c2, c3)) AS c1, ARRAY_AGG(c1) AS c2
FROM row_tbl;

CREATE MATERIALIZED VIEW row_array_where AS SELECT
ARRAY_AGG(ROW(c2, c3)) FILTER(WHERE c2 < c3) AS f_c1,
ARRAY_AGG(c1) FILTER(WHERE c2 < c3) AS f_c2
FROM row_tbl;

CREATE MATERIALIZED VIEW row_array_where_gby AS SELECT
id,
ARRAY_AGG(ROW(c2, c3)) FILTER(WHERE c2 < c3) AS f_c1,
ARRAY_AGG(c1) FILTER(WHERE c2 < c3) AS f_c2
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_count_col AS SELECT
COUNT(ROW(c1, c3)) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_count_col_distinct AS SELECT
COUNT(DISTINCT ROW(c1, c2, c3)) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_count_col_distinct_gby AS SELECT
id, COUNT(DISTINCT ROW(c1, c2, c3)) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_count_col_gby AS SELECT
id, COUNT(ROW(c1, c3)) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_count_col_where AS SELECT
COUNT(ROW(c1, c2, c3)) FILTER(WHERE c2 < c3) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_count_col_where_gby AS SELECT
id, COUNT(ROW(c1, c2, c3)) FILTER(WHERE c2 < c3) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_max_distinct AS SELECT
MAX(DISTINCT ROW(c1, c2, c3)) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_max_distinct_gby AS SELECT
id,
MAX(DISTINCT ROW(c1, c2, c3)) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_max_gby AS SELECT
id,
MAX(ROW(c1, c2, c3)) AS c1,
MAX(ROW(c2, c1, c3)) AS c2
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_max AS SELECT
MAX(ROW(c1, c2, c3)) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_max_where AS SELECT
MAX(ROW(c1, c2, c3)) FILTER(WHERE c2 < c3) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_max_where_gby AS SELECT
id, MAX(ROW(c1, c2, c3)) FILTER(WHERE c2 < c3) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_min_distinct AS SELECT
MIN(DISTINCT ROW(c1, c2, c3)) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_min_distinct_gby AS SELECT
id,
MIN(DISTINCT ROW(c1, c2, c3)) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_min_gby AS SELECT
id,
MIN(ROW(c1, c2, c3)) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_min AS SELECT
MIN(ROW(c1, c2, c3)) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_min_where AS SELECT
MIN(ROW(c1, c2, c3)) FILTER(WHERE c2 < c3) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_min_where_gby AS SELECT
id, MIN(ROW(c1, c2, c3)) FILTER(WHERE c2 < c3) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_some AS SELECT
SOME(ROW(c3, c2) !=  ROW(c2, c3)) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_some_distinct AS SELECT
SOME(DISTINCT ROW(c3, c2) !=  ROW(c3, c2)) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_some_distinct_gby AS SELECT
id, SOME(DISTINCT ROW(c3, c2) !=  ROW(c3, c2)) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_some_gby AS SELECT
id, SOME(ROW(c3, c2) !=  ROW(c2, c3)) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_some_where AS SELECT
SOME(ROW(c3, c2) =  ROW(c2, c3)) FILTER(WHERE c2 IS NULL) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_some_where_gby AS SELECT
id, SOME(ROW(c3, c2) =  ROW(c2, c3)) FILTER(WHERE c2 IS NULL) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_every AS SELECT
EVERY(ROW(c3, c2) !=  ROW(c2, c3)) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_every_distinct AS SELECT
EVERY(DISTINCT ROW(c3, c2) !=  ROW(c3, c2)) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_every_distinct_gby AS SELECT
id, EVERY(DISTINCT ROW(c3, c2) !=  ROW(c3, c2)) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_every_gby AS SELECT
id, EVERY(ROW(c3, c2) !=  ROW(c2, c3)) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW row_every_where AS SELECT
EVERY(ROW(c3, c2) =  ROW(c2, c3)) FILTER(WHERE c2 IS NULL) AS c1
FROM row_tbl;

CREATE MATERIALIZED VIEW row_every_where_gby AS SELECT
id, EVERY(ROW(c3, c2) =  ROW(c2, c3)) FILTER(WHERE c2 IS NULL) AS c1
FROM row_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW argmax_emp_test_row AS SELECT
ARG_MAX(ROW(c1, c2, c3), c2) AS argmax
FROM row_tbl
WHERE FALSE;

CREATE MATERIALIZED VIEW argmin_emp_test_row AS SELECT
ARG_MIN(ROW(c1, c2, c3), c2) AS argmin
FROM row_tbl
WHERE FALSE;

CREATE MATERIALIZED VIEW arrgg_emp_test_row AS SELECT
ARRAY_AGG(ROW(c2, c3)) AS arragg
FROM row_tbl
WHERE FALSE;

CREATE MATERIALIZED VIEW avg_emp AS SELECT
AVG(c1) FILTER(WHERE c1 < 1) AS c1_avg,
AVG(c2) FILTER(WHERE c2 < 2) AS c2_avg
FROM int_tbl;

CREATE MATERIALIZED VIEW count_col_emp_row AS SELECT
COUNT(DISTINCT ROW(c1, c2, c3)) AS count_col
FROM row_tbl
WHERE FALSE;

CREATE MATERIALIZED VIEW every_emp_row AS SELECT
EVERY(c1 > SAFE_CAST(c2 AS INT)) AS evry
FROM row_tbl;

CREATE MATERIALIZED VIEW max_emp_row AS SELECT
MAX(ROW(c1, c2, c3)) FILTER(WHERE c1 IS NULL) AS max
FROM row_tbl;

CREATE MATERIALIZED VIEW min_emp_row AS SELECT
MIN(ROW(c1, c2, c3)) AS min
FROM row_tbl
WHERE FALSE;

CREATE MATERIALIZED VIEW some_emp_row AS SELECT
SOME(c1 > SAFE_CAST(c2 AS INT)) AS sme
FROM row_tbl;

CREATE MATERIALIZED VIEW stdev_pop_emp AS SELECT
STDDEV_POP(c1) AS stdev_pop
FROM int_tbl
WHERE c1 = 7;

CREATE MATERIALIZED VIEW stdev_samp_emp AS SELECT
STDDEV_SAMP(c1) FILTER(WHERE c1 < 1) AS stdev_samp
FROM int_tbl;

CREATE MATERIALIZED VIEW sum_emp AS SELECT
SUM(c1) FILTER(WHERE c1 < 1) AS sum
FROM int_tbl;

CREATE MATERIALIZED VIEW real_max_distinct AS SELECT
CAST(MAX(DISTINCT c1) AS VARCHAR) AS c1,
CAST(MAX(DISTINCT c2) AS VARCHAR) AS c2
FROM real_tbl;

CREATE MATERIALIZED VIEW real_max_distinct_gby AS SELECT
id,
CAST(MAX(DISTINCT c1) AS VARCHAR) AS c1,
CAST(MAX(DISTINCT c2) AS VARCHAR) AS c2
FROM real_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW real_max_gby AS SELECT
id,
CAST(MAX(c1) AS VARCHAR) AS c1,
CAST(MAX(c2) AS VARCHAR) AS c2
FROM real_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW real_max AS SELECT
CAST(MAX(c1) AS VARCHAR) AS c1,
CAST(MAX(c2) AS VARCHAR) AS c2
FROM real_tbl;

CREATE MATERIALIZED VIEW real_max_where AS SELECT
CAST(MAX(c1) FILTER (WHERE c1 > c2) AS VARCHAR) AS f_c1,
CAST(MAX(c2) FILTER (WHERE c1 > c2) AS VARCHAR) AS f_c2
FROM real_tbl;

CREATE MATERIALIZED VIEW real_max_where_gby AS SELECT
id,
CAST(MAX(c1) FILTER (WHERE c1 > c2) AS VARCHAR) AS f_c1,
CAST(MAX(c2) FILTER (WHERE c1 > c2) AS VARCHAR) AS f_c2
FROM real_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW real_min_distinct AS SELECT
CAST(MIN(DISTINCT c1) AS VARCHAR) AS c1,
CAST(MIN(DISTINCT c2) AS VARCHAR) AS c2
FROM real_tbl;

CREATE MATERIALIZED VIEW real_min_distinct_gby AS SELECT
id,
CAST(MIN(DISTINCT c1) AS VARCHAR) AS c1,
CAST(MIN(DISTINCT c2) AS VARCHAR) AS c2
FROM real_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW real_min_gby AS SELECT
id,
CAST(MIN(c1) AS VARCHAR) AS c1,
CAST(MIN(c2) AS VARCHAR) AS c2
FROM real_tbl
GROUP BY id;

CREATE MATERIALIZED VIEW real_min AS SELECT
CAST(MIN(c1) AS VARCHAR) AS c1,
CAST(MIN(c2) AS VARCHAR) AS c2
FROM real_tbl;

CREATE MATERIALIZED VIEW real_min_where AS SELECT
CAST(MIN(c1) FILTER (WHERE c1 > c2) AS VARCHAR) AS f_c1,
CAST(MIN(c2) FILTER (WHERE c1 > c2) AS VARCHAR) AS f_c2
FROM real_tbl;

CREATE MATERIALIZED VIEW real_min_where_gby AS SELECT
id,
CAST(MIN(c1) FILTER (WHERE c1 > c2) AS VARCHAR) AS f_c1,
CAST(MIN(c2) FILTER (WHERE c1 > c2) AS VARCHAR) AS f_c2
FROM real_tbl
GROUP BY id;
