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

In generated SQL, "*" should be followed by space

    XMLWordPrintableJSON

Details

    Description

      Printing a query with the following parameters  gives a result

      SELECT *FROM TAB

      Note: no space between "*" and "FROM".

      val parser = SqlParser.create("",
        SqlParser.configBuilder()
          .setCaseSensitive(false)
         .setParserFactory(SqlParserImpl.FACTORY)
         .setQuoting(Quoting.DOUBLE_QUOTE)
          .build())
      
      val query = parser.parseQuery("select * from tab")
      val actual = query.toSqlString { c: SqlWriterConfig ->
          c.withDialect(PostgresqlSqlDialect.DEFAULT)
            .withAlwaysUseParentheses(false)
            .withSelectListItemsOnSeparateLines(false)
            .withCaseClausesOnNewLines(false)
            .withQuoteAllIdentifiers(false)
            .withIndentation(0)
            .withClauseStartsLine(false)
            .withFromFolding(SqlWriterConfig.LineFolding.WIDE)
            .withSelectFolding(SqlWriterConfig.LineFolding.WIDE)
            .withLineFolding(SqlWriterConfig.LineFolding.WIDE)
         }.sql
      println(actual)
      

      Attachments

        Issue Links

          Activity

            People

              nobigo xiong duan
              rrrrrr111 Roman Churganov
              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 - 1h 10m
                  1h 10m