Kim Jin Chul has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/8508


Change subject: IMPALA-5237: support custom string in date/time format
......................................................................

IMPALA-5237: support custom string in date/time format

Impala does not represent a custom string at date/time format. For example,
addtional custom string between the patterns(e.g. HH\'H\' => 11H)
Hive supports this feature, so user wants to get a same result
from Impala. By the way, Impala returns a different result as below.

* Hive
> select from_unixtime(1492677564, 'HH\'H\' mm\'M\' ss\'S\'');
08H 39M 24S

* Impala
> select from_unixtime(1492677564, 'HH\'H\' mm\'M\' ss\'S\'');
08'8' 39'4' 24'0'

The change affects the format pattern for from_unixtime/from_timestamp.

There is one intentional difference between Hive and Impala.
In Impala, the format string should have any date or time patten as below.

* Hive
> select from_unixtime(0, '\'Hello world!\'');
Hello world!

* Impala
> select from_unixtime(0, '\'Hello world!\'');
Bad date/time conversion format: 'Hello world!'

Testing:
Add unit tests for working and nonworking cases

Change-Id: Ie34055ac695748bcfb110bfa6ed5308f469ea178
---
M be/src/exprs/expr-test.cc
M be/src/runtime/timestamp-parse-util.cc
2 files changed, 28 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/08/8508/1
--
To view, visit http://gerrit.cloudera.org:8080/8508
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie34055ac695748bcfb110bfa6ed5308f469ea178
Gerrit-Change-Number: 8508
Gerrit-PatchSet: 1
Gerrit-Owner: Kim Jin Chul <jinc...@gmail.com>

Reply via email to