You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Roman Churganov (Jira)" <ji...@apache.org> on 2020/08/05 20:10:00 UTC

[jira] [Created] (CALCITE-4158) Printing a query with asterix

Roman Churganov created CALCITE-4158:
----------------------------------------

             Summary: Printing a query with asterix 
                 Key: CALCITE-4158
                 URL: https://issues.apache.org/jira/browse/CALCITE-4158
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.23.0
            Reporter: Roman Churganov


printing a query with next params  gives a result SELECT *FROM TAB  (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)

 

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)