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

JDBC adapter sometimes adds unnecessary parentheses around SELECT in WITH body

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.33.0
    • None

    Description

      Note: This issue is related to https://issues.apache.org/jira/browse/CALCITE-5265

      You should view comments in CALCITE-5265 before you view this issue.

      Add a case in SqlParserTest:

       

      // code placeholder
      @Test void testWithSelect() {
        final String sql = "with emp2 as (select * from emp)\n"
            + "select * from emp2\n";
        final String expected = "WITH `EMP2` AS (SELECT *\n" +
            "FROM `EMP`) SELECT *\n" +
            "FROM `EMP2`";
        sql(sql).ok(expected);
      } 

      will fail, because actual sql is with parentheses.

       

      Attachments

        Issue Links

          Activity

            People

              4wei Mou Wu
              4wei Mou Wu
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 3h 20m
                  3h 20m