You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/06/09 14:49:45 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #6608: Port remaining tests in functions.rs to sqllogictest

alamb commented on code in PR #6608:
URL: https://github.com/apache/arrow-datafusion/pull/6608#discussion_r1224409214


##########
datafusion/core/tests/sqllogictests/test_files/functions.slt:
##########
@@ -479,4 +479,90 @@ SELECT struct(c1,c2,c3,c4,a,b) from simple_struct_test
 {c0: 1, c1: 1, c2: 3.1, c3: 3.14, c4: str, c5: text}
 
 statement ok
-drop table simple_struct_test
\ No newline at end of file
+drop table simple_struct_test
+
+# create aggregate_test_100 table for functions test
+statement ok
+CREATE EXTERNAL TABLE aggregate_test_100 (
+  c1  VARCHAR NOT NULL,
+  c2  TINYINT NOT NULL,
+  c3  SMALLINT NOT NULL,
+  c4  SMALLINT,
+  c5  INT,
+  c6  BIGINT NOT NULL,
+  c7  SMALLINT NOT NULL,
+  c8  INT NOT NULL,
+  c9  BIGINT UNSIGNED NOT NULL,
+  c10 VARCHAR NOT NULL,
+  c11 FLOAT NOT NULL,
+  c12 DOUBLE NOT NULL,
+  c13 VARCHAR NOT NULL
+)
+STORED AS CSV
+WITH HEADER ROW
+LOCATION '../../testing/data/csv/aggregate_test_100.csv'
+
+
+# sqrt_f32_vs_f64
+query R
+SELECT avg(sqrt(c11)) FROM aggregate_test_100
+----
+0.6584408485889435
+
+query R
+SELECT avg(CAST(sqrt(c11) AS double)) FROM aggregate_test_100
+----
+0.6584408485889435
+
+query R
+SELECT avg(sqrt(CAST(c11 AS double))) FROM aggregate_test_100
+----
+0.6584408483418833
+
+statement ok
+drop table aggregate_test_100
+
+
+# case_sensitive_identifiers_functions
+statement ok
+create table t as values (

Review Comment:
   I think using 2 is a better value than 1 👍 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org