trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
9.88k stars 2.86k forks source link

Query failing with "statement is too large" is not listed in web UI #6073

Open findepi opened 3 years ago

findepi commented 3 years ago

in case of

Caused by: java.sql.SQLException: Query failed (#20201124_125143_00016_u62dr): line 1:1: statement is too large (stack overflow while parsing)
    at io.prestosql.jdbc.AbstractPrestoResultSet.resultsException(AbstractPrestoResultSet.java:1777)
    at io.prestosql.jdbc.PrestoResultSet.getColumns(PrestoResultSet.java:242)
    at io.prestosql.jdbc.PrestoResultSet.create(PrestoResultSet.java:53)
    at io.prestosql.jdbc.PrestoStatement.internalExecute(PrestoStatement.java:249)
    at io.prestosql.jdbc.PrestoStatement.execute(PrestoStatement.java:227)
    at io.prestosql.jdbc.PrestoPreparedStatement.<init>(PrestoPreparedStatement.java:99)
    at io.prestosql.jdbc.PrestoConnection.prepareStatement(PrestoConnection.java:141)
    ... 17 more
Caused by: io.prestosql.jdbc.$internal.client.FailureInfo.FailureException: line 1:1: statement is too large (stack overflow while parsing)
    at io.prestosql.sql.parser.SqlParser.invokeParser(SqlParser.java:153)
    at io.prestosql.sql.parser.SqlParser.createStatement(SqlParser.java:84)
    at io.prestosql.execution.QueryPreparer.prepareQuery(QueryPreparer.java:55)
    at io.prestosql.dispatcher.DispatchManager.createQueryInternal(DispatchManager.java:184)
    at io.prestosql.dispatcher.DispatchManager.lambda$createQuery$0(DispatchManager.java:153)
    at io.prestosql.$gen.Presto_testversion____20201124_125104_1.run(Unknown Source)

thus, eg it's hard to know what the actual query sent by the user

STTianXiang commented 3 years ago

For example, if I paste a 600-line SQL in presto-cli, it will report OOM.