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

Excess quotes in generated SQL when STAR is a column alias

    XMLWordPrintableJSON

Details

    Description

      The following valid SQL query:

      select "customer_id" as "*" from "customer";
      

      changes slightly semantics when it is parsed, optimized, and transformed back to SQL via RelToSqlConverter.

      Actual

      SELECT "customer_id" AS """*""" FROM "foodmart"."customer";
      

      Note the extra quotes appearing in the AS clause. Aliasing columns differently is undesirable and can have an impact when this query pattern appears as part of a larger query and there are usages of the alias.

      Expected

      SELECT "customer_id" AS "*" FROM "foodmart"."customer";
      

      Attachments

        Issue Links

          Activity

            People

              zabetak Stamatis Zampetakis
              zabetak Stamatis Zampetakis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h