[
https://issues.apache.org/jira/browse/CALCITE-6431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17855907#comment-17855907
]
xiong duan commented on CALCITE-6431:
-------------------------------------
Spark and Hive will throw exception 'Scalar subquery expression returns more
than one row' :
{code:java}
SELECT CASE COUNT(*) WHEN 0 THEN NULL WHEN 1 THEN MIN(`product_class_id`) ELSE
(SELECT NULL UNION ALL SELECT NULL) END `$f0` FROM `foodmart`.`product`{code}
It doesn't matter how much this expression(count(*)) returns, it will not
affect the result.
> Implement the SINGLE_VALUE aggregation in HiveSqlDialect And SparkSQLDialect
> ----------------------------------------------------------------------------
>
> Key: CALCITE-6431
> URL: https://issues.apache.org/jira/browse/CALCITE-6431
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.37.0
> Reporter: xiong duan
> Assignee: xiong duan
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.38.0
>
>
> When we use the SQL including the scalar query, converting this SQL Rel to
> HiveSQL will include the SINGLE_VALUE aggregation function(HiveSQL can't
> handle it) in the dialect SQL.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)