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 "Bikramjeet Vig (JIRA)" <ji...@apache.org> on 2018/12/11 23:42:01 UTC
[jira] [Created] (IMPALA-7960) wrong results when comparing
timestamp casted to varchar of smaller length to a string literal in a
binary predicate
Bikramjeet Vig created IMPALA-7960:
--------------------------------------
Summary: wrong results when comparing timestamp casted to varchar of smaller length to a string literal in a binary predicate
Key: IMPALA-7960
URL: https://issues.apache.org/jira/browse/IMPALA-7960
Project: IMPALA
Issue Type: Bug
Affects Versions: Impala 2.12.0
Reporter: Bikramjeet Vig
Assignee: Bikramjeet Vig
Expression rewriting seems to identify this as a redundant cast and removes it.
Steps to re-create:
{noformat}
select * from (select cast('2018-12-11 09:59:37' as timestamp) as ts) tbl where cast(ts as varchar(10)) = '2018-12-11';
{noformat}
output:
{noformat}
Fetched 0 row(s)
{noformat}
Now disable expression re-writes.
{noformat}
set ENABLE_EXPR_REWRITES=false;
select * from (select cast('2018-12-11 09:59:37' as timestamp) as ts) tbl where cast(ts as varchar(10)) = '2018-12-11';
{noformat}
output:
{noformat}
+---------------------+
| ts |
+---------------------+
| 2018-12-11 09:59:37 |
+---------------------+
{noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org