cloud-fan commented on a change in pull request #32949:
URL: https://github.com/apache/spark/pull/32949#discussion_r667063336



##########
File path: sql/core/src/test/resources/sql-tests/results/ansi/interval.sql.out
##########
@@ -1213,25 +1404,53 @@ integer overflow
 -- !query
 SELECT
   from_csv('1, 1 day', 'a INT, b interval'),
+  from_csv('1, 1', 'a INT, b interval day'),
   to_csv(from_csv('1, 1 day', 'a INT, b interval')),
-  to_csv(named_struct('a', interval 32 month, 'b', interval 70 minute)),
-  from_csv(to_csv(named_struct('a', interval 32 month, 'b', interval 70 
minute)), 'a interval, b interval')
+  to_csv(from_csv('1, 1', 'a INT, b interval day')),
+  to_csv(named_struct('a', interval 32 hour, 'b', interval 70 minute)),
+  from_csv(to_csv(named_struct('a', interval 32 hour, 'b', interval 70 
minute)), 'a interval hour, b interval minute')
 -- !query schema
-struct<from_csv(1, 1 day):struct<a:int,b:interval>,to_csv(from_csv(1, 1 
day)):string,to_csv(named_struct(a, INTERVAL '2 years 8 months', b, INTERVAL '1 
hours 10 minutes')):string,from_csv(to_csv(named_struct(a, INTERVAL '2 years 8 
months', b, INTERVAL '1 hours 10 minutes'))):struct<a:interval,b:interval>>
+struct<from_csv(1, 1 day):struct<a:int,b:interval>,from_csv(1, 
1):struct<a:int,b:interval day>,to_csv(from_csv(1, 1 
day)):string,to_csv(from_csv(1, 1)):string,to_csv(named_struct(a, INTERVAL '32' 
HOUR, b, INTERVAL '70' MINUTE)):string,from_csv(to_csv(named_struct(a, INTERVAL 
'32' HOUR, b, INTERVAL '70' MINUTE))):struct<a:interval hour,b:interval minute>>
 -- !query output
-{"a":1,"b":1 days}     1,1 days        2 years 8 months,1 hours 10 minutes     
{"a":2 years 8 months,"b":1 hours 10 minutes}
+{"a":1,"b":1 days}     {"a":1,"b":1 00:00:00.000000000}        1,1 days        
1,INTERVAL '1' DAY      INTERVAL '32' HOUR,INTERVAL '70' MINUTE {"a":1 
08:00:00.000000000,"b":0 01:10:00.000000000}

Review comment:
       In CSV, we ignore the interval fields and always print the full format 
of interval strings? I thought CSV will print `1` for `interval 1 day`.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to