# Copyright Materialize, Inc. and contributors. All rights reserved. # # Use of this software is governed by the Business Source License # included in the LICENSE file at the root of this repository. # # As of the Change Date specified in that file, in accordance with # the Business Source License, use of this software will be governed # by the Apache License, Version 2.0. # use mode cockroach because it "respects the scale of a Decimal type and the precision of a floating point number" # even though mode standard would allow easier file comparisons with the other computation mode mode cockroach # ------------------------------- # very small numbers # ------------------------------- statement ok CREATE TABLE t_using_dataflow_rendering (real1 REAL, double1 DOUBLE PRECISION, numeric1 NUMERIC); statement ok INSERT INTO t_using_dataflow_rendering VALUES (1e-39::real, 1e-39::double, 1e-39::numeric); # DIFF TO CONSTANT FOLDING (SELECT on types [REAL, DOUBLE])! # to be addressed with https://github.com/MaterializeInc/database-issues/issues/4341 query RRR SELECT * FROM t_using_dataflow_rendering UNION ALL SELECT SUM(real1), SUM(double1), SUM(numeric1) FROM t_using_dataflow_rendering; ---- 0 0 0.000000000000000000000000000000000000001 0.000000000000000000000000000000000000001 0.000000000000000000000000000000000000001 0.000000000000000000000000000000000000001 query T multiline EXPLAIN OPTIMIZED PLAN WITH (humanized expressions) AS VERBOSE TEXT FOR SELECT * FROM t_using_dataflow_rendering; ---- Explained Query: ReadStorage materialize.public.t_using_dataflow_rendering Source materialize.public.t_using_dataflow_rendering Target cluster: quickstart EOF # ------------------------------- # very big numbers # ------------------------------- statement ok DELETE FROM t_using_dataflow_rendering; statement ok INSERT INTO t_using_dataflow_rendering VALUES (1e38::real, 1e38::double, 1e38::numeric); # DIFF TO CONSTANT FOLDING (SELECT on types [REAL, DOUBLE])! # to be addressed with https://github.com/MaterializeInc/database-issues/issues/4341 query RRR SELECT * FROM t_using_dataflow_rendering UNION ALL SELECT SUM(real1), SUM(double1), SUM(numeric1) FROM t_using_dataflow_rendering; ---- 10141205000000000000000000000000 10141204801825835000000000000000 100000000000000000000000000000000000000 100000000000000000000000000000000000000 100000000000000000000000000000000000000 100000000000000000000000000000000000000 query T multiline EXPLAIN OPTIMIZED PLAN WITH (humanized expressions) AS VERBOSE TEXT FOR SELECT * FROM t_using_dataflow_rendering; ---- Explained Query: ReadStorage materialize.public.t_using_dataflow_rendering Source materialize.public.t_using_dataflow_rendering Target cluster: quickstart EOF