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 2019/11/20 04:40:49 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #26599: [SPARK-29961][SQL] Implement builtin function - typeof

dongjoon-hyun commented on a change in pull request #26599: [SPARK-29961][SQL] Implement builtin function - typeof
URL: https://github.com/apache/spark/pull/26599#discussion_r348288867
 
 

 ##########
 File path: sql/core/src/test/resources/sql-tests/inputs/misc-functions.sql
 ##########
 @@ -0,0 +1,11 @@
+-- test for misc functions
+
+-- typeof
+select typeof(null);
+select typeof(true);
+select typeof(1Y), typeof(1S), typeof(1), typeof(1L);
+select typeof(cast(1.0 as float)), typeof(1.0D), typeof(1.2);
+select typeof(date '1986-05-23'),  typeof(timestamp '1986-05-23'), typeof(interval '23 days');
+select typeof(x'ABCD'), typeof('SPARK');
+select typeof(array(1, 2)), typeof(map(1, 2));
+select typeof(struct(a, b)) from values (1, 'SPARK') tbl(a, b);
 
 Review comment:
   Shall we use `named_struct('a', 1, 'b', 'spark')`? Then, you can simply add this to line 10 for all complex types.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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