Skip to content

Commit

Permalink
Use scientific notation for doubles in HQL
Browse files Browse the repository at this point in the history
Despite
 https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-FloatingPointTypes
saying "Floating point literals are assumed to be DOUBLE. Scientific
notation is not yet supported."

- Hive 1.2 supports scientific notation
- hive 3 interprets decimal literals as decimals
  • Loading branch information
findepi committed Oct 1, 2019
1 parent ae41ee2 commit eaf51c9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions presto-hive/src/test/sql/create-test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,13 @@ SELECT
, CASE WHEN n % 27 = 0 THEN NULL ELSE map('test key', 'test value') END
, CASE WHEN n % 29 = 0 THEN NULL ELSE array('abc', 'xyz', 'data') END
, CASE WHEN n % 31 = 0 THEN NULL ELSE
array(named_struct('s_string', 'test abc', 's_double', 0.1),
named_struct('s_string' , 'test xyz', 's_double', 0.2)) END
array(named_struct('s_string', 'test abc', 's_double', 1e-1),
named_struct('s_string' , 'test xyz', 's_double', 2e-1)) END
, CASE WHEN n % 31 = 0 THEN NULL ELSE
named_struct('s_string', 'test abc', 's_double', 0.1) END
named_struct('s_string', 'test abc', 's_double', 1e-1) END
, CASE WHEN n % 33 = 0 THEN NULL ELSE
map(1, array(named_struct('s_string', 'test abc', 's_double', 0.1),
named_struct('s_string' , 'test xyz', 's_double', 0.2))) END
map(1, array(named_struct('s_string', 'test abc', 's_double', 1e-1),
named_struct('s_string' , 'test xyz', 's_double', 2e-1))) END
FROM presto_test_sequence
LIMIT 100
;
Expand Down

0 comments on commit eaf51c9

Please sign in to comment.