[
https://issues.apache.org/jira/browse/TAJO-2110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15249265#comment-15249265
]
ASF GitHub Bot commented on TAJO-2110:
--------------------------------------
Github user jihoonson commented on the pull request:
https://github.com/apache/tajo/pull/993#issuecomment-212263282
Here is another bug. The result of addition of ```timestamp``` or
```date``` with ```interval``` is invalid.
```
default> \set
...
'TIMEZONE'='Asia/Seoul'
...
default> \d test
table name: default.test
table uri: hdfs://localhost:7020/tajo/warehouse/default/test
store type: TEXT
number of rows: 1
volume: 52 B
Options:
'timezone'='Asia/Seoul'
'text.delimiter'='|'
schema:
t TIME
ts TIMESTAMP
d DATE
default> select ts from test;
ts
-------------------------------
2015-05-01 15:01:23
2016-05-01 16:02:33
(2 rows, 0.03 sec, 0 B selected)
default> select ts + interval '5' day from test;
day
-------------------------------
2015-05-01 15:01:23
2016-05-01 16:02:33
(2 rows, 0.02 sec, 0 B selected)
default> select d from test;
d
-------------------------------
2015-05-01
2016-05-01
(2 rows, 0.018 sec, 0 B selected)
default> select d + interval '5' day from test;
day
-------------------------------
2015-05-01 00:00:00
2016-05-01 00:00:00
(2 rows, 0.016 sec, 0 B selected)
default> select ts from test;
ts
-------------------------------
2015-05-01 15:01:23
2016-05-01 16:02:33
(2 rows, 0.018 sec, 0 B selected)
default> select ts - interval '5' day from test;
day
-------------------------------
2015-05-01 15:01:23
2016-05-01 16:02:33
(2 rows, 0.014 sec, 0 B selected)
default> select d from test;
d
-------------------------------
2015-05-01
2016-05-01
(2 rows, 0.027 sec, 0 B selected)
default> select d - interval '5' day from test;
day
-------------------------------
2015-05-01 00:00:00
2016-05-01 00:00:00
(2 rows, 0.017 sec, 0 B selected)
```
It is weird because tests for interval datum are already included.
> Fix incorrect DateTime and remove hard coded tests
> --------------------------------------------------
>
> Key: TAJO-2110
> URL: https://issues.apache.org/jira/browse/TAJO-2110
> Project: Tajo
> Issue Type: Bug
> Components: Data Type, Storage, Unit Test
> Affects Versions: 0.12.0
> Reporter: Jinho Kim
> Assignee: Jinho Kim
> Priority: Critical
>
> Currently, Most DateTime tests are not work correctly. because timezone is
> hardcode to the GMT for testing.
> if you run CTAS, the result data will be incorrect. we should remove the
> hardcoded timezone in TajoTestingCluster
> Here is some examples:
> Example 1
> {noformat}
> if you run CTAS, the result data will be incorrect
> default> create table test1 (col1 TIMESTAMP);
> default> insert overwrite into test1 select '2016-04-04 00:00:00'::TIMESTAMP;
> default> select * from test1;
> col1
> -------------------------------
> 2016-04-04 00:00:00
> (1 rows, 0.057 sec, 0 B selected)
> default> create table test2 as select * from test1;
> [=========================================>] 100% 0.105 sec
> (1 rows, 0.105 sec, 20 B inserted)
> default> select * from test2;
> col1
> -------------------------------
> 2016-04-03 15:00:00
> {noformat}
> Example 2
> {noformat}
> default> select '2016-04-04 01:00:00'::TIMESTAMP - interval '1 hour';
> ?minus
> -------------------------------
> 2016-04-04 09:00:00
> (1 rows, 0.005 sec, 0 B selected)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)