[
https://issues.apache.org/jira/browse/CALCITE-6434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17854583#comment-17854583
]
xiong duan commented on CALCITE-6434:
-------------------------------------
Fixed in
[05923bf|https://github.com/apache/calcite/commit/05923bf4dbe1900b3b04939a8d254acad2faeff4].
> JDBC adapter generates wrong SQL for Spark and Hive because it fails to quote
> an identifier containing '$'
> ----------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-6434
> URL: https://issues.apache.org/jira/browse/CALCITE-6434
> 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
>
>
> The SQL:
> {code:java}
> SELECT product.product_class_id C
> FROM foodmart.product
> LEFT JOIN (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) t0 ON TRUE
> WHERE product.net_weight > t0.$f0{code}
> Generate by SINGLE_VALUE agg function.
> This SQL will parse failed in Spark Unless we add the identifier quoting like
> `t0`.`$f0`
> I will add identifier Quote String for Spark and Hive, Here is the document:
> * [https://spark.apache.org/docs/latest/sql-ref-identifier.html]
> *
> [https://cwiki.apache.org/confluence/display/Hive/Configuration+Properties#ConfigurationProperties-hive.support.quoted.identifiers]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)