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 "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/02/16 17:19:00 UTC

[jira] [Commented] (IMPALA-11049) Order by clause contains cast expr execute failed after 'SimplifyCastExprRule' rewrite

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

ASF subversion and git services commented on IMPALA-11049:
----------------------------------------------------------

Commit 345ba685e74aa002fc5934b104183f141d9cb367 in impala's branch refs/heads/master from skyyws
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=345ba68 ]

IMPALA-11049: Added expr analyzed check in 'SimplifyCastExprRule.java'

We added a new expr rewrite rule 'SimplifyCastExprRule.java' in
IMPALA-10836. If expr is not analyzed, this rewrite rule would throw
an 'AnalysisException', this is due to 'orderByElements_' not been
analyzed. We try to substitute order by elements when creating
'SortInfo', but caused some other problems. So we only add expr
analyzed check in this rule to solve this problem. When adding other
expr rewrite rules in the future, we should also add this check.

Testing:
- Added test cases in 'explain-level3.test'

Change-Id: I2780e04a6d5a32e224cd0470cf6f166a832363ec
Reviewed-on: http://gerrit.cloudera.org:8080/18099
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Order by clause contains cast expr execute failed after 'SimplifyCastExprRule' rewrite
> --------------------------------------------------------------------------------------
>
>                 Key: IMPALA-11049
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11049
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 4.1.0
>            Reporter: Sheng Wang
>            Assignee: Sheng Wang
>            Priority: Major
>
> When add new rewrite rule 'SimplifyCastExprRule' in IMPALA-10836, this query will execute failed:
> {code:java}
> explain
> SELECT month(to_timestamp(cast(d_date_sk AS string),'yyyy-MM-dd')) aa
> FROM date_dim
> GROUP BY month(to_timestamp(cast(d_date_sk AS string),'yyyy-MM-dd'))
> ORDER BY month(to_timestamp(cast(d_date_sk AS string),'yyyy-MM-dd')) LIMIT 10;
> {code}
> The exception is:
> {code:java}
> ERROR: AnalysisException: No matching function with signature: to_timestamp(INT, STRING).
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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