From eaf51c9ae67f3bfdbda23f1fd6dea1a1590fb0cc Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Wed, 21 Aug 2019 14:58:52 +0200 Subject: [PATCH] Use scientific notation for doubles in HQL 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 --- presto-hive/src/test/sql/create-test.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/presto-hive/src/test/sql/create-test.sql b/presto-hive/src/test/sql/create-test.sql index bb95cf78fd5b..666b8aa1f64f 100644 --- a/presto-hive/src/test/sql/create-test.sql +++ b/presto-hive/src/test/sql/create-test.sql @@ -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 ;