Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6434

JDBC adapter generates wrong SQL for Spark and Hive because it fails to quote an identifier containing '$'

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.37.0
    • 1.38.0
    • core

    Description

      The SQL:

      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

      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:

      Attachments

        Issue Links

          Activity

            People

              nobigo xiong duan
              nobigo xiong duan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: