You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/07/09 11:38:59 UTC

[GitHub] [hive] sankarh commented on a change in pull request #2445: HIVE-25306: Move Date and Timestamp parsing from ResolverStyle.LENIENT to ResolverStyle.STRICT

sankarh commented on a change in pull request #2445:
URL: https://github.com/apache/hive/pull/2445#discussion_r666676465



##########
File path: ql/src/test/queries/clientpositive/ambiguitycheck.q
##########
@@ -32,11 +32,9 @@ select int(1.2) from src limit 1;
 select bigint(1.34) from src limit 1;
 select binary('1') from src limit 1;
 select boolean(1) from src limit 1;
-select date('1') from src limit 2;

Review comment:
       Why these queries are removed?

##########
File path: ql/src/test/queries/clientpositive/materialized_view_rewrite_in_between.q
##########
@@ -12,7 +12,7 @@ create database expr2;
 use expr2;
 create table sales(prod_id int, cust_id int, store_id int, sale_date timestamp, qty int, amt double, descr string);
 insert into sales values
-(11,1,101,'12/24/2013',1000,1234.00,'onedummytwo');
+(11,1,101,'2013-12-24',1000,1234.00,'onedummytwo');

Review comment:
       Is this a change in supported formats? 

##########
File path: serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/primitive/PrimitiveObjectInspectorUtils.java
##########
@@ -1254,10 +1257,13 @@ public static Timestamp getTimestampFromString(String s) {
     s = s.trim();
     s = trimNanoTimestamp(s);
 
+    if(StringUtils.isEmpty(s))
+      return null;
+
     try {
       return TimestampUtils.stringToTimestamp(s);
-    } catch (IllegalArgumentException e) {
-      return null;
+    } catch (IllegalArgumentException | DateTimeException e) {
+      throw new IllegalArgumentException("Cannot parse " + s);

Review comment:
       What is the impact of throwing the exception instead of returning null? 

##########
File path: ql/src/test/queries/clientpositive/type_conversions_1.q
##########
@@ -18,9 +18,3 @@ select
   cast(null as binary)
 from src limit 1;
 
--- Invalid conversions, should all be null

Review comment:
       Why removed?




-- 
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: gitbox-unsubscribe@hive.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org