You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jr...@apache.org on 2017/10/12 20:33:59 UTC

[1/2] incubator-impala git commit: IMPALA-5983: Fix crash in to/from_utc_timestamp("10:00:00", 'MSK')

Repository: incubator-impala
Updated Branches:
  refs/heads/master 0bddf0fb6 -> 9ba923948


IMPALA-5983: Fix crash in to/from_utc_timestamp("10:00:00", 'MSK')

Moscow timezone is handled differrently than other timezones,
and it was possible to cause unhandled boost exception by
trying to convert "dateless" timestamps like "10:00:00".

These timestamps cannot be handled by timestamp conversion
generally, because daylight saving time logic needs month
and day to work correctly. The condition HasDateOrTime()
incorrectly suggested that these timestamps can be handled,
so I made the condition stricter.

Change-Id: I592389333a16a15a680beed389e2702dfc16fe1d
Reviewed-on: http://gerrit.cloudera.org:8080/8139
Tested-by: Impala Public Jenkins
Reviewed-by: Lars Volker <lv...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/f2357a22
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/f2357a22
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/f2357a22

Branch: refs/heads/master
Commit: f2357a227e8e95742caebab4e7e6c27cbf4cafeb
Parents: 0bddf0f
Author: Csaba Ringhofer <cs...@cloudera.com>
Authored: Tue Sep 26 17:37:14 2017 +0200
Committer: Lars Volker <lv...@cloudera.com>
Committed: Thu Oct 12 16:39:26 2017 +0000

----------------------------------------------------------------------
 be/src/exprs/expr-test.cc           | 5 +++++
 be/src/exprs/timestamp-functions.cc | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/f2357a22/be/src/exprs/expr-test.cc
----------------------------------------------------------------------
diff --git a/be/src/exprs/expr-test.cc b/be/src/exprs/expr-test.cc
index a460f5f..c45f4a8 100644
--- a/be/src/exprs/expr-test.cc
+++ b/be/src/exprs/expr-test.cc
@@ -5002,6 +5002,11 @@ TEST_F(ExprTest, MoscowTimezoneConversion) {
   TestStringValue(MSC_TO_UTC("2015-06-20 12:00:00"), "2015-06-20 09:00:00");
   TestStringValue(MSC_TO_UTC("2015-12-20 12:00:00"), "2015-12-20 09:00:00");
 
+  // Timestamp conversions of "dateless" times should return null (and not crash,
+  // see IMPALA-5983).
+  TestIsNull(UTC_TO_MSC("10:00:00"), TYPE_STRING);
+  TestIsNull(MSC_TO_UTC("10:00:00"), TYPE_STRING);
+
 #pragma pop_macro("MSC_TO_UTC")
 #pragma pop_macro("UTC_TO_MSC")
 }

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/f2357a22/be/src/exprs/timestamp-functions.cc
----------------------------------------------------------------------
diff --git a/be/src/exprs/timestamp-functions.cc b/be/src/exprs/timestamp-functions.cc
index 9cb5430..d9372fb 100644
--- a/be/src/exprs/timestamp-functions.cc
+++ b/be/src/exprs/timestamp-functions.cc
@@ -81,7 +81,7 @@ TimestampVal TimestampFunctions::FromUtc(FunctionContext* context,
     const TimestampVal& ts_val, const StringVal& tz_string_val) {
   if (ts_val.is_null || tz_string_val.is_null) return TimestampVal::null();
   const TimestampValue& ts_value = TimestampValue::FromTimestampVal(ts_val);
-  if (!ts_value.HasDateOrTime()) return TimestampVal::null();
+  if (!ts_value.HasDateAndTime()) return TimestampVal::null();
 
   const StringValue& tz_string_value = StringValue::FromStringVal(tz_string_val);
   time_zone_ptr timezone = TimezoneDatabase::FindTimezone(
@@ -119,7 +119,7 @@ TimestampVal TimestampFunctions::ToUtc(FunctionContext* context,
     const TimestampVal& ts_val, const StringVal& tz_string_val) {
   if (ts_val.is_null || tz_string_val.is_null) return TimestampVal::null();
   const TimestampValue& ts_value = TimestampValue::FromTimestampVal(ts_val);
-  if (!ts_value.HasDateOrTime()) return TimestampVal::null();
+  if (!ts_value.HasDateAndTime()) return TimestampVal::null();
 
   const StringValue& tz_string_value = StringValue::FromStringVal(tz_string_val);
   time_zone_ptr timezone = TimezoneDatabase::FindTimezone(


[2/2] incubator-impala git commit: [DOCS] Fix alphabetical ordering of query options

Posted by jr...@apache.org.
[DOCS] Fix alphabetical ordering of query options

There were 2 DE options out of order amongst the DI
ones:

DEBUG_ACTION
DEFAULT_JOIN_DISTRIBUTION_MODE
DEFAULT_ORDER_BY_LIMIT
DISABLE_CODEGEN
DECIMAL_V2
DEFAULT_SPILLABLE_BUFFER_SIZE

Moved DECIMAL_V2 and DEFAULT_SPILLABLE_BUFFER_SIZE
to the right respective positions.

Change-Id: Ib43d868489c4daaf584e932c19eeb568faf1ebc8
Reviewed-on: http://gerrit.cloudera.org:8080/8265
Reviewed-by: Laurel Hale <la...@cloudera.com>
Reviewed-by: John Russell <jr...@cloudera.com>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/9ba92394
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/9ba92394
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/9ba92394

Branch: refs/heads/master
Commit: 9ba92394816d033aef10d69d8767b73ce9f68a09
Parents: f2357a2
Author: John Russell <jr...@cloudera.com>
Authored: Thu Oct 12 10:42:41 2017 -0700
Committer: Impala Public Jenkins <im...@gerrit.cloudera.org>
Committed: Thu Oct 12 20:30:57 2017 +0000

----------------------------------------------------------------------
 docs/impala.ditamap | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/9ba92394/docs/impala.ditamap
----------------------------------------------------------------------
diff --git a/docs/impala.ditamap b/docs/impala.ditamap
index 3dd5137..6fc5f69 100644
--- a/docs/impala.ditamap
+++ b/docs/impala.ditamap
@@ -178,12 +178,12 @@ under the License.
           <topicref rev="2.10.0 IMPALA-3200" href="topics/impala_buffer_pool_limit.xml"/>
           <topicref href="topics/impala_compression_codec.xml"/>
           <topicref href="topics/impala_debug_action.xml"/>
+          <topicref rev="2.9.0" href="topics/impala_decimal_v2.xml"/>
           <topicref rev="2.9.0 IMPALA-5381" href="topics/impala_default_join_distribution_mode.xml"/>
           <topicref href="topics/impala_default_order_by_limit.xml"/>
+          <topicref rev="2.10.0 IMPALA-3200" href="topics/impala_default_spillable_buffer_size.xml"/>
           <topicref audience="hidden" href="topics/impala_disable_cached_reads.xml"/>
           <topicref href="topics/impala_disable_codegen.xml"/>
-          <topicref rev="2.9.0" href="topics/impala_decimal_v2.xml"/>
-          <topicref rev="2.10.0 IMPALA-3200" href="topics/impala_default_spillable_buffer_size.xml"/>
           <topicref audience="hidden" href="topics/impala_disable_outermost_topn.xml"/>
           <topicref rev="2.5.0" href="topics/impala_disable_row_runtime_filtering.xml"/>
           <topicref rev="2.5.0" href="topics/impala_disable_streaming_preaggregations.xml"/>
@@ -222,8 +222,8 @@ under the License.
           <topicref rev="2.5.0" href="topics/impala_runtime_filter_wait_time_ms.xml"/>
           <topicref rev="2.6.0" href="topics/impala_s3_skip_insert_staging.xml"/>
           <topicref rev="2.5.0" href="topics/impala_scan_node_codegen_threshold.xml"/>
-          <topicref rev="2.8.0 IMPALA-3671" href="topics/impala_scratch_limit.xml"/>
           <topicref rev="2.5.0" href="topics/impala_schedule_random_replica.xml"/>
+          <topicref rev="2.8.0 IMPALA-3671" href="topics/impala_scratch_limit.xml"/>
           <!-- This option is for internal use only and might go away without ever being documented. -->
           <!-- <topicref href="topics/impala_seq_compression_mode.xml"/> -->
           <topicref href="topics/impala_support_start_over.xml"/>