Review Board 1.7.22


HIVE-5382

Review Request #14430 - Created Oct. 1, 2013 and updated

Hari Sankar Sivarama Subramaniyan
HIVE-5382
Reviewers
hive
ashutoshc, haglein, thejas
hive
Allow casting of exponential notation whenever possible. 
Limitations:
1. The exponential part will be limited between MIN_VAL and MAX_VAL of the data types even if the final result might be within the boundaries.
2. Allow loss-less transformation using BigDecimal and Double types.
Ran basic tests on cast_to_int.
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/cast_to_int.q
Revision 1528177 New Change
[20] 23 lines
[+20]
24
  cast('32767' as smallint),
24
  cast('32767' as smallint),
25
  cast('-32768' as smallint),
25
  cast('-32768' as smallint),
26
  cast('-128' as tinyint),
26
  cast('-128' as tinyint),
27
  cast('127' as tinyint),
27
  cast('127' as tinyint),
28
  cast('1.0a' as int),
28
  cast('1.0a' as int),
29
  cast('-1.-1' as int)
29
  cast('-1.-1' as int),

    
   
30
  cast('1.23e3' as int),

    
   
31
  cast('-1.5e2' as int),

    
   
32
  cast('1e+9' as int),

    
   
33
  cast('1e-2' as int),

    
   
34
  cast('1e+10' as int),

    
   
35
  cast('1e+10' as bigint),

    
   
36
  cast('1e2-34' as int)
30
from src limit 1;
37
from src limit 1;
http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/results/clientpositive/cast_to_int.q.out
Revision 1528177 New Change
 
http://svn.apache.org/repos/asf/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyInteger.java
Revision 1528177 New Change
 
http://svn.apache.org/repos/asf/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyLong.java
Revision 1528177 New Change
 
  1. http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/queries/clientpositive/cast_to_int.q: Loading...
  2. http://svn.apache.org/repos/asf/hive/trunk/ql/src/test/results/clientpositive/cast_to_int.q.out: Loading...
  3. http://svn.apache.org/repos/asf/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyInteger.java: Loading...
  4. http://svn.apache.org/repos/asf/hive/trunk/serde/src/java/org/apache/hadoop/hive/serde2/lazy/LazyLong.java: Loading...