You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Csaba Ringhofer (Jira)" <ji...@apache.org> on 2020/02/12 16:46:00 UTC

[jira] [Comment Edited] (IMPALA-8909) Timestamp timezone conversion causes impalad crash

    [ https://issues.apache.org/jira/browse/IMPALA-8909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17035504#comment-17035504 ] 

Csaba Ringhofer edited comment on IMPALA-8909 at 2/12/20 4:45 PM:
------------------------------------------------------------------

I played with this issue again. I am still not sure about the commit that fixed the original crash in release mode - it seems to work fine since 3.*.

About the debug crash: the issue is actually not related to the timestamp being invalid. The following can reproduce it too:
{code}
create table tkudu (t timestamp primary key) partition by hash(t) partitions 2 stored as kudu;
create table tsource (t string);
insert into tsource values ("2020-02-02");
insert into tkudu select concat(t, " 00:00:00") from tsource;
{code}

The string after concatenation can be converted to a valid timestamp, but we still hit the same assert in debug mode.
If we add cast(... as timestamp) around the concat, then it works fine if the string can be converted to a  valid timestamp while it gives a proper error message if it is not.

So I think that the still present crash in DEBUG build is a frontend issue: the query should be either rejected, or an implicit cast should be added around concat.
I also checked what happens if the Kudu primary key column is am int instead of a timestamp - the query is rejected:
{code}
ERROR: AnalysisException: Target table 'default.tkuduint' is incompatible with source expressions.
Expression 'concat(t, ' 00:00:00')' (type: STRING) is not compatible with column 't' (type: INT)
{code}





was (Author: csringhofer):
I played with this issue again. I still not sure about the commit that fixed the original crash in release mode - it seems to work fine since 3.*.

About the debug crash: the issue is actually not related to the timestamp being invalid. The following can reproduce it too:
{code}
create table tkudu (t timestamp primary key) partition by hash(t) partitions 2 stored as kudu;
create table tsource (t string);
insert into tsource values ("2020-02-02");
insert into tkudu select concat(t, " 00:00:00") from tsource;
{code}

The string after concatenation can be converted to a valid timestamp, but we still hit the same assert in debug mode.
If we add cast(... as timestamp) around the concat, then it works fine if the string can be converted to a  valid timestamp while it gives a proper error message if it is not.

So I think that the still present crash in DEBUG build is a frontend issue: the query should be either rejected, or an implicit cast should be added around concat.
I also checked what happens if the Kudu primary key column is a int instead of a timestamp - the query is rejected:
{code}
ERROR: AnalysisException: Target table 'default.tkuduint' is incompatible with source expressions.
Expression 'concat(t, ' 00:00:00')' (type: STRING) is not compatible with column 't' (type: INT)
{code}




> Timestamp timezone conversion causes impalad crash
> --------------------------------------------------
>
>                 Key: IMPALA-8909
>                 URL: https://issues.apache.org/jira/browse/IMPALA-8909
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 2.12.0
>         Environment: centos 7.5
>            Reporter: qi
>            Assignee: Csaba Ringhofer
>            Priority: Blocker
>              Labels: crash
>
> step1: create two tables
> {code:java}
> CREATE TABLE temp.t_one
> (
>   id string,
>   test_time timestamp,
>   name string,
>   PRIMARY KEY(id,test_time)
> )
> PARTITION BY HASH (id) PARTITIONS 8,
> RANGE(test_time)
> (
>   PARTITION VALUES < '2011-01-01 00:00:00',
>   PARTITION '2011-01-01 00:00:00' <= VALUES < '2021-01-01 00:00:00',
>   PARTITION '2021-01-01 00:00:00' <= VALUES
> )
> STORED AS KUDU;
> CREATE TABLE temp.t_two
> (
>   cdate string,
>   ctime string
> );
> {code}
> step2:insert some data into t_two
> {code:java}
> insert into temp.t_two values('20190101','00:00:00');
> {code}
> step3:insert data into t_one from t_two,*{color:#FF0000}cause impalad crash!!{color}*{color:#172b4d}{color}
> {code:java}
> insert into temp.t_one( id, test_time, name )
> select '1' as id,concat(cdate,ctime) as test_time,'gogogo' as name
> from temp.t_two;
> {code}
>  
> impalad.ERROR
> {code:java}
> terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::gregorian::bad_year> >'
>   what():  Year is out of valid range: 1400..10000
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org