[
https://issues.apache.org/jira/browse/DRILL-2269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14326792#comment-14326792
]
Jinfeng Ni commented on DRILL-2269:
-----------------------------------
Test with hive function "ucase" and "lcase" in a filter condition. On master
branch, it will hit exception. With the patch, the query runs fine.
On master,
{code}
+------------+
| commit_id |
+------------+
| d4dc295f1c46555a4cba774e0b211de72c119e29 |
+------------+
select * from voter where ucase(name) = 'NICK MILLER' and lcase(name) = 'nick
miller';
Query failed: RemoteRpcException: Failure while running fragment., The type of
org.apache.drill.exec.expr.HiveFuncHolderExpr doesn't currently support
LogicalExpression.getCumulativeCost(). [ 1a27a0f5-8fe8-4b34-80e4-efd6a8f99947
on drlvm-245.qa.lab:31010 ]
[ 1a27a0f5-8fe8-4b34-80e4-efd6a8f99947 on drlvm-245.qa.lab:31010 ]
{code}
With DRILL-2269 patch:
{code}
select * from voter where ucase(name) = 'NICK MILLER' and lcase(name) = 'nick
miller';
+------------+------------+------------+--------------+---------------+------------+-------------+
| voter_id | name | age | registration | contributions | voterzone |
create_time |
+------------+------------+------------+--------------+---------------+------------+-------------+
…..
4 rows selected (1.019 seconds)
0: jdbc:drill:schema=dfs.par100> select commit_message from sys.version;
+----------------+
| commit_message |
+----------------+
| DRILL-2269: Add default implementation for estimating cost of evaluating an
expression, in stead of throwing Exception. |
+----------------+
1 row selected (0.091 seconds)
{code}
> Provide default implementation for getting cost of evaluating an expression
> in base class of LogicalExpression, in stead of throw Exception
> --------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DRILL-2269
> URL: https://issues.apache.org/jira/browse/DRILL-2269
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Reporter: Jinfeng Ni
> Assignee: Jinfeng Ni
> Fix For: 0.8.0
>
> Attachments:
> 0001-DRILL-2269-Add-default-implementation-for-estimating.patch
>
>
> Today, the abstract class of LogicalExpression will throw Exception for two
> methods related to estimate the cost of evaluating an expression, in the hope
> that sub classes will override those two methods. However, if someone forgets
> to override, compiler and mvn build process will still be successful, yet
> will hit Exception in execution-time, complaining the sub class does not
> implement these methods. As Drill's adding more sub classes of
> LogicalExpression to the code base, it's more likely for someone to forget to
> override those two methods, making it error-prone to just throw Exception in
> the base class.
> In stead, we should provide a default implementation for those two methods in
> the base class. Certain sub classes will override to change the behavior.
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)