[
https://issues.apache.org/jira/browse/CALCITE-6790?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17914106#comment-17914106
]
ZheHu edited comment on CALCITE-6790 at 1/18/25 3:32 AM:
---------------------------------------------------------
I think dialect is the right way to go, you are very welcome to submit a PR for
this case.
By the way, you may need to check if OFFSET syntax is correct in
VerticaSqlDialect when using unparseFetchUsingLimit.
was (Author: vae):
I think dialect is the right way to go, you are very welcome to submit a PR for
this case.
> Write LIMIT for fetch operations in Vertica
> -------------------------------------------
>
> Key: CALCITE-6790
> URL: https://issues.apache.org/jira/browse/CALCITE-6790
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.38.0
> Reporter: Illes S
> Priority: Trivial
> Labels: Vertica, dialect
>
> Vertica does not support {{FETCH NEXT ? ROWS ONLY}} syntax:
> *SQL*
> {code:sql}
> SELECT * FROM dual LIMIT 1 {code}
> *actual*
> {code:sql}
> SELECT *
> FROM "dual"
> FETCH NEXT 1 ROWS ONLY
> {code}
> *expected*
> {code:sql}
> SELECT *
> FROM "dual"
> LIMIT 1
> {code}
> The fix seems to be adding this to
> [VerticaSqlDialect.java|https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/sql/dialect/VerticaSqlDialect.java]:
> {code:java}
> @Override
> public void unparseOffsetFetch(SqlWriter writer, @Nullable SqlNode
> offset, @Nullable SqlNode fetch) {
> unparseFetchUsingLimit(writer, offset, fetch);
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)