You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/09/14 05:49:44 UTC

[GitHub] [spark] sarutak commented on a change in pull request #33988: [SPARK-36683][SQL] Add new built-in SQL functions: SEC and CSC

sarutak commented on a change in pull request #33988:
URL: https://github.com/apache/spark/pull/33988#discussion_r707925829



##########
File path: sql/core/src/test/resources/sql-tests/results/operators.sql.out
##########
@@ -259,11 +259,83 @@ struct<pmod(-7, 3):int>
 
 
 -- !query
+select sec(1)
+-- !query schema
+struct<SEC(1):double>
+-- !query output
+1.8508157176809255
+
+
+-- !query
+select sec(null)
+-- !query schema
+struct<SEC(NULL):double>
+-- !query output
+NULL
+
+
+-- !query
+select sec(0)
+-- !query schema
+struct<SEC(0):double>
+-- !query output
+1.0
+
+
+-- !query
+select sec(-1)
+-- !query schema
+struct<SEC(-1):double>
+-- !query output
+1.8508157176809255
+
+
+-- !query
+select csc(1)
+-- !query schema
+struct<CSC(1):double>
+-- !query output
+1.1883951057781212
+
+
+-- !query
+select csc(null)
+-- !query schema
+struct<CSC(NULL):double>
+-- !query output
+NULL
+
+
+-- !query
+select csc(0)
+-- !query schema
+struct<CSC(0):double>
+-- !query output
+Infinity
+
+
+-- !query
+select csc(-1)
+-- !query schema
+struct<CSC(-1):double>
+-- !query output
+-1.1883951057781212
+
+
+-- !query
+:
 select cot(1)
 -- !query schema
-struct<COT(1):double>
+struct<>
 -- !query output
-0.6420926159343306
+org.apache.spark.sql.catalyst.parser.ParseException

Review comment:
       This `ParseException` is caused by the syntax error in `select csc(-1);:`.

##########
File path: sql/core/src/test/resources/sql-tests/inputs/operators.sql
##########
@@ -40,6 +40,14 @@ select 5 % 3;
 select pmod(-7, 3);
 
 -- math functions
+select sec(1);
+select sec(null);
+select sec(0);
+select sec(-1);
+select csc(1);
+select csc(null);
+select csc(0);
+select csc(-1);:

Review comment:
       Unnecessary `:` here.




-- 
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: reviews-unsubscribe@spark.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org