You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for ANSI SQL syntax FETCH FIRST N ROWS WITH TIES. The actual SQL might look like the following.
CREATETABLEmemory.default.table_with_arrayASSELECT1 id, ARRAY[1, 42, 2, 42, 4, 42] my_array
SELECT nationkey, element
FROMtpch.tiny.nation
JOINmemory.default.table_with_array twa ON nationkey =twa.idCROSS JOIN UNNEST(my_array) a(element)
ORDER BY element OFFSET 1 FETCH FIRST 3 ROWS WITH TIES
line 1:196: mismatched input 'WITH'. Expecting: 'ONLY'
com.facebook.presto.sql.parser.ParsingException: line 1:196: mismatched input 'WITH'. Expecting: 'ONLY'
at com.facebook.presto.sql.parser.ErrorHandler.syntaxError(ErrorHandler.java:109)
at org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
at org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
at org.antlr.v4.runtime.DefaultErrorStrategy.reportInputMismatch(DefaultErrorStrategy.java:327)
at org.antlr.v4.runtime.DefaultErrorStrategy.reportError(DefaultErrorStrategy.java:139)
at com.facebook.presto.sql.parser.SqlBaseParser.queryNoWith(SqlBaseParser.java:5965)
at com.facebook.presto.sql.parser.SqlBaseParser.query(SqlBaseParser.java:4643)
at com.facebook.presto.sql.parser.SqlBaseParser.statement(SqlBaseParser.java:2189)
at com.facebook.presto.sql.parser.SqlBaseParser.singleStatement(SqlBaseParser.java:271)
at com.facebook.presto.sql.parser.SqlParser.invokeParser(SqlParser.java:173)
at com.facebook.presto.sql.parser.SqlParser.createStatement(SqlParser.java:108)
at com.facebook.presto.sql.analyzer.BuiltInQueryPreparer.prepareQuery(BuiltInQueryPreparer.java:70)
at com.facebook.presto.sql.analyzer.BuiltInQueryPreparer.prepareQuery(BuiltInQueryPreparer.java:56)
at com.facebook.presto.dispatcher.DispatchManager.createQueryInternal(DispatchManager.java:290)
at com.facebook.presto.dispatcher.DispatchManager.lambda$createQuery$0(DispatchManager.java:254)
at com.facebook.airlift.concurrent.BoundedExecutor.drainQueue(BoundedExecutor.java:78)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.antlr.v4.runtime.InputMismatchException
at com.facebook.presto.sql.parser.SqlParser$2.recoverInline(SqlParser.java:147)
at org.antlr.v4.runtime.Parser.match(Parser.java:206)
at com.facebook.presto.sql.parser.SqlBaseParser.queryNoWith(SqlBaseParser.java:5947)
... 13 more
Presto Component, Service, or Connector
Presto Service.
Possible Implementation
I lack the expertise in this area, so I'm afraid there's nothing I can do.
SELECT nationkey, element
FROMtpch.tiny.nation
JOINmemory.default.table_with_array twa ON nationkey =twa.idCROSS JOIN UNNEST(my_array) a(element)
ORDER BY element OFFSET 1 FETCH FIRST 3 ROWS ONLY
linghengqian
changed the title
Lack of support for the ANSI SQL syntax FETCH FIRST N ROWS WITH TIES.
Lack of support for the ANSI SQL syntax FETCH FIRST N ROWS WITH TIESJul 16, 2024
Expected Behavior or Use Case
FETCH FIRST N ROWS WITH TIES
. The actual SQL might look like the following.Presto Component, Service, or Connector
Possible Implementation
Example Screenshots (if appropriate):
Context
prestodb/presto
testcontainers/testcontainers-java#8946 and [Feature]: Presto Module uses the outdated Docker Image ofghcr.io/trinodb/presto
and needs to be updated toprestodb/presto
testcontainers/testcontainers-java#8657 side, testcontainers-java exists a small test set to test ANSI SQL, so I currently have to rewrite the original SQL as follows.FETCH FIRST N ROWS ONLY
is supported in Presto 0.280, so it seems that supportingFETCH FIRST N ROWS WITH TIES
is a natural thing.The text was updated successfully, but these errors were encountered: