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

Rui Wang edited comment on CALCITE-3731 at 1/16/20 5:50 PM:
------------------------------------------------------------

Agreed with all above.  IF, CASE and Coalesce can all be converted to CASE WHEN 
and then share the same implementation. 

 

What can be investigated is if Calcite is doing such conversion. E.g. if you 
have a "IF" in parser, then in generated plan if it's converted to CASE. (I 
don't have an answer now)


was (Author: amaliujia):
Agreed with all above.  IF, CASE and Coalesce can all be converted to CASE WHEN 
and then share the same implementation. 

> Add IF function for BigQuery, Hive and Spark Dialects
> -----------------------------------------------------
>
>                 Key: CALCITE-3731
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3731
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: vaibhav jain
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> Adding support for *IF* function for BigQuery, Hive and Spark Dialects.
> *Syntax*- IF(condition, true_result, false_result)
> If *condition* is true, returns *true_result*, else returns *false_result*.
> Document links:
> [BigQuery|https://cloud.google.com/bigquery/docs/reference/standard-sql/conditional_expressions]
> [Hive 
> |https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-ConditionalFunctions]
> [Spark Sql|https://spark.apache.org/docs/2.3.1/api/sql/index.html#if]



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

Reply via email to