[
https://issues.apache.org/jira/browse/CALCITE-4158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Hyde updated CALCITE-4158:
---------------------------------
Description:
Printing a query with the following parameters gives a result
{noformat}SELECT *FROM TAB{noformat}
Note: no space between "*" and "FROM".
{code}
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)
{code}
was:
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)
> Missing space after "*"
> -----------------------
>
> 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
> Priority: Major
>
> Printing a query with the following parameters gives a result
> {noformat}SELECT *FROM TAB{noformat}
> Note: no space between "*" and "FROM".
> {code}
> 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)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)