Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function with LOOP fails with "Compiler failed [...] break target does not exist" when run on worker #21682

Closed
findepi opened this issue Apr 24, 2024 · 2 comments · Fixed by #21691
Labels
bug Something isn't working

Comments

@findepi
Copy link
Member

findepi commented Apr 24, 2024

With an inline routine like this

WITH FUNCTION replace_certain_characters(s varchar)
RETURNS VARCHAR
BEGIN 
    DECLARE i INT DEFAULT 1;

    loop_label: LOOP
        IF i = 10 THEN
            LEAVE loop_label;
        END IF;
        SET s = regexp_replace(s, ARRAY['b'][i]);
        SET i = i + 1;
    END LOOP;
    RETURN s;
END
SELECT replace_certain_characters('abc');

the behavior is not consistent across runs:

$ for i in `seq 5`; do trino --file foo.sql; done
Query 20240424_092850_00244_un2hb failed: com.google.common.base.VerifyException: break target does not exist

Query 20240424_092851_00245_un2hb failed: Array subscript must be less than or equal to array length: 2 > 1

Query 20240424_092851_00246_un2hb failed: com.google.common.base.VerifyException: break target does not exist

Query 20240424_092852_00247_un2hb failed: Array subscript must be less than or equal to array length: 2 > 1

Query 20240424_092853_00248_un2hb failed: com.google.common.base.VerifyException: break target does not exist

Array subscript must be less than or equal to array length: 2 > 1 is an expected failure
break target does not exist is an unexpected one. Full stacktrace for it

Query 20240424_092937_00249_un2hb failed: com.google.common.base.VerifyException: break target does not exist
java.lang.RuntimeException: com.google.common.base.VerifyException: break target does not exist
	at io.trino.metadata.FunctionManager.getScalarFunctionImplementation(FunctionManager.java:97)
	at io.trino.sql.InterpretedFunctionInvoker.invoke(InterpretedFunctionInvoker.java:63)
	at io.trino.sql.planner.IrExpressionInterpreter$Visitor.visitCall(IrExpressionInterpreter.java:632)
	at io.trino.sql.planner.IrExpressionInterpreter$Visitor.visitCall(IrExpressionInterpreter.java:158)
	at io.trino.sql.ir.Call.accept(Call.java:51)
	at io.trino.sql.ir.IrVisitor.process(IrVisitor.java:27)
	at io.trino.sql.planner.IrExpressionInterpreter$Visitor.processWithExceptionHandling(IrExpressionInterpreter.java:171)
	at io.trino.sql.planner.IrExpressionInterpreter$Visitor.lambda$visitRow$13(IrExpressionInterpreter.java:806)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Collections$2.tryAdvance(Collections.java:5073)
	at java.base/java.util.Collections$2.forEachRemaining(Collections.java:5081)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
	at io.trino.sql.planner.IrExpressionInterpreter$Visitor.visitRow(IrExpressionInterpreter.java:807)
	at io.trino.sql.planner.IrExpressionInterpreter$Visitor.visitRow(IrExpressionInterpreter.java:158)
	at io.trino.sql.ir.Row.accept(Row.java:45)
	at io.trino.sql.ir.IrVisitor.process(IrVisitor.java:27)
	at io.trino.sql.planner.IrExpressionInterpreter$Visitor.processWithExceptionHandling(IrExpressionInterpreter.java:171)
	at io.trino.sql.planner.IrExpressionInterpreter.evaluate(IrExpressionInterpreter.java:143)
	at io.trino.sql.planner.LocalExecutionPlanner$Visitor.visitValues(LocalExecutionPlanner.java:2119)
	at io.trino.sql.planner.LocalExecutionPlanner$Visitor.visitValues(LocalExecutionPlanner.java:870)
	at io.trino.sql.planner.plan.ValuesNode.accept(ValuesNode.java:130)
	at io.trino.sql.planner.LocalExecutionPlanner$Visitor.visitOutput(LocalExecutionPlanner.java:959)
	at io.trino.sql.planner.LocalExecutionPlanner$Visitor.visitOutput(LocalExecutionPlanner.java:870)
	at io.trino.sql.planner.plan.OutputNode.accept(OutputNode.java:82)
	at io.trino.sql.planner.LocalExecutionPlanner.plan(LocalExecutionPlanner.java:638)
	at io.trino.sql.planner.LocalExecutionPlanner.plan(LocalExecutionPlanner.java:542)
	at io.trino.execution.SqlTaskExecutionFactory.create(SqlTaskExecutionFactory.java:83)
	at io.trino.execution.SqlTask.tryCreateSqlTaskExecution(SqlTask.java:563)
	at io.trino.execution.SqlTask.updateTask(SqlTask.java:514)
	at io.trino.execution.SqlTaskManager.doUpdateTask(SqlTaskManager.java:558)
	at io.trino.execution.SqlTaskManager.lambda$updateTask$9(SqlTaskManager.java:490)
	at io.trino.$gen.Trino_testversion____20240424_091639_36.call(Unknown Source)
	at io.trino.execution.SqlTaskManager.updateTask(SqlTaskManager.java:490)
	at io.trino.server.TaskResource.createOrUpdateTask(TaskResource.java:153)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:159)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:263)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:266)
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:242)
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:697)
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:312)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614)
	at io.airlift.http.server.TraceTokenFilter.doFilter(TraceTokenFilter.java:62)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
	at io.airlift.http.server.TimingFilter.doFilter(TimingFilter.java:51)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1547)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:819)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:431)
	at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:464)
	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:597)
	at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:851)
	at org.eclipse.jetty.server.Handler$Wrapper.handle(Handler.java:740)
	at org.eclipse.jetty.server.handler.EventsHandler.handle(EventsHandler.java:81)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:151)
	at org.eclipse.jetty.server.Server.handle(Server.java:179)
	at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:619)
	at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:411)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
	at org.eclipse.jetty.util.thread.MonitoredQueuedThreadPool$1.run(MonitoredQueuedThreadPool.java:73)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: com.google.common.base.VerifyException: break target does not exist
	at com.google.common.base.Verify.verify(Verify.java:126)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBreak(SqlRoutineCompiler.java:374)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBreak(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrBreak.accept(IrBreak.java:29)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBlock(SqlRoutineCompiler.java:343)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBlock(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrBlock.accept(IrBlock.java:41)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitIf(SqlRoutineCompiler.java:384)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitIf(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrIf.accept(IrIf.java:35)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBlock(SqlRoutineCompiler.java:343)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBlock(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrBlock.accept(IrBlock.java:41)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.lambda$visitLoop$2(SqlRoutineCompiler.java:420)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.compileLoop(SqlRoutineCompiler.java:447)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitLoop(SqlRoutineCompiler.java:416)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitLoop(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrLoop.accept(IrLoop.java:32)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBlock(SqlRoutineCompiler.java:343)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBlock(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrBlock.accept(IrBlock.java:41)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitRoutine(SqlRoutineCompiler.java:312)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitRoutine(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrRoutine.accept(IrRoutine.java:35)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler.generateRunMethod(SqlRoutineCompiler.java:230)
	at io.trino.sql.routine.SqlRoutineCompiler.compileClass(SqlRoutineCompiler.java:174)
	at io.trino.sql.routine.SqlRoutineCompiler.compile(SqlRoutineCompiler.java:135)
	at io.trino.metadata.WorkerLanguageFunctionProvider.specialize(WorkerLanguageFunctionProvider.java:56)
	at io.trino.metadata.FunctionManager.getScalarFunctionImplementationInternal(FunctionManager.java:105)
	at io.trino.metadata.FunctionManager.lambda$getScalarFunctionImplementation$0(FunctionManager.java:93)
	at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4938)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3576)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2318)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2191)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2081)
	at com.google.common.cache.LocalCache.get(LocalCache.java:4019)
	at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4933)
	at com.google.common.cache.ForwardingCache.get(ForwardingCache.java:55)
	at io.trino.cache.CacheUtils.uncheckedCacheGet(CacheUtils.java:37)
	at io.trino.metadata.FunctionManager.getScalarFunctionImplementation(FunctionManager.java:93)
	... 96 more
@findepi findepi added the bug Something isn't working label Apr 24, 2024
@findepi
Copy link
Member Author

findepi commented Apr 24, 2024

This seems related to use of IdentityHashMap for io.trino.sql.routine.SqlRoutineCompiler.BytecodeVisitor#breakLabels.
There would be no "break target does not exist', ie the entry would be found if it was a non-identity based set.
The map keys are records and per @martint 's comment #21632 (comment) right, the records are generally not supposed to be used for identity-based identification. Maybe the fix would be just that?

I don't understand why sometimes there are two (equal) IrLabels and sometimes there is one. Something to do with function deserialization?

cc @electrum

@findepi findepi changed the title Function execution spuriously fails with: "break target does not exist" Function with loop fails with "break target does not exist" (unless executed on the coordinator) Apr 24, 2024
@findepi
Copy link
Member Author

findepi commented Apr 24, 2024

I don't understand why sometimes there are two (equal) IrLabels and sometimes there is one.

Compilation does not fail on coordinator. in case of WITH FUNCTION, LanguageFunctionManager that is used on the coordinator has access to function definitions that did not go thru serialization.
Setting node-scheduler.include-coordinator=false forces execution to be always scheduled on the worker. There, WorkerLanguageFunctionProvider is used which compiles function code that arrived thru task updates. There the object identity is lost and function cannot be compiled again.

A deterministic repo does not use VALUES and thus forces worker distribution

$ trino --debug
trino> WITH FUNCTION leave_loop(s varchar)
    -> RETURNS integer
    -> BEGIN
    ->     loop_label: LOOP
    ->         LEAVE loop_label;
    ->     END LOOP;
    ->     RETURN 42;
    -> END
    -> SELECT leave_loop(name) FROM tpch.tiny.nation;
Query 20240424_135915_00036_erzet failed: Compiler failed. Possible reasons include: the query may have too many or too complex expressions, or the underlying tables may have too many columns
io.trino.spi.TrinoException: Compiler failed. Possible reasons include: the query may have too many or too complex expressions, or the underlying tables may have too many columns
	at io.trino.sql.planner.LocalExecutionPlanner$Visitor.visitScanFilterAndProject(LocalExecutionPlanner.java:2038)
	at io.trino.sql.planner.LocalExecutionPlanner$Visitor.visitProject(LocalExecutionPlanner.java:1926)
	at io.trino.sql.planner.LocalExecutionPlanner$Visitor.visitProject(LocalExecutionPlanner.java:870)
	at io.trino.sql.planner.plan.ProjectNode.accept(ProjectNode.java:81)
	at io.trino.sql.planner.LocalExecutionPlanner$Visitor.visitOutput(LocalExecutionPlanner.java:959)
	at io.trino.sql.planner.LocalExecutionPlanner$Visitor.visitOutput(LocalExecutionPlanner.java:870)
	at io.trino.sql.planner.plan.OutputNode.accept(OutputNode.java:82)
	at io.trino.sql.planner.LocalExecutionPlanner.plan(LocalExecutionPlanner.java:638)
	at io.trino.sql.planner.LocalExecutionPlanner.plan(LocalExecutionPlanner.java:542)
	at io.trino.execution.SqlTaskExecutionFactory.create(SqlTaskExecutionFactory.java:83)
	at io.trino.execution.SqlTask.tryCreateSqlTaskExecution(SqlTask.java:563)
	at io.trino.execution.SqlTask.updateTask(SqlTask.java:514)
	at io.trino.execution.SqlTaskManager.doUpdateTask(SqlTaskManager.java:558)
	at io.trino.execution.SqlTaskManager.lambda$updateTask$9(SqlTaskManager.java:490)
	at io.trino.$gen.Trino_testversion____20240424_135447_36.call(Unknown Source)
	at io.trino.execution.SqlTaskManager.updateTask(SqlTaskManager.java:490)
	at io.trino.server.TaskResource.createOrUpdateTask(TaskResource.java:153)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:146)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:189)
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$VoidOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:159)
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:93)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400)
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81)
	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:263)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
	at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:266)
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:242)
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:697)
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394)
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:358)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:312)
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHolder.handle(ServletHolder.java:736)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1614)
	at io.airlift.http.server.TraceTokenFilter.doFilter(TraceTokenFilter.java:62)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
	at io.airlift.http.server.TimingFilter.doFilter(TimingFilter.java:51)
	at org.eclipse.jetty.ee10.servlet.FilterHolder.doFilter(FilterHolder.java:205)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1586)
	at org.eclipse.jetty.ee10.servlet.ServletHandler$MappedServlet.handle(ServletHandler.java:1547)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.dispatch(ServletChannel.java:819)
	at org.eclipse.jetty.ee10.servlet.ServletChannel.handle(ServletChannel.java:431)
	at org.eclipse.jetty.ee10.servlet.ServletHandler.handle(ServletHandler.java:464)
	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:597)
	at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:851)
	at org.eclipse.jetty.server.Handler$Wrapper.handle(Handler.java:740)
	at org.eclipse.jetty.server.handler.EventsHandler.handle(EventsHandler.java:81)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:151)
	at org.eclipse.jetty.server.Server.handle(Server.java:179)
	at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:619)
	at org.eclipse.jetty.server.internal.HttpConnection.onFillable(HttpConnection.java:411)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:322)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:99)
	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:478)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:441)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:293)
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:201)
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:311)
	at org.eclipse.jetty.util.thread.MonitoredQueuedThreadPool$1.run(MonitoredQueuedThreadPool.java:73)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:979)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1209)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1164)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: com.google.common.util.concurrent.UncheckedExecutionException: com.google.common.base.VerifyException: break target does not exist
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2087)
	at com.google.common.cache.LocalCache.get(LocalCache.java:4019)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4042)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5024)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5031)
	at com.google.common.cache.ForwardingLoadingCache.getUnchecked(ForwardingLoadingCache.java:54)
	at io.trino.sql.gen.ExpressionCompiler.compileCursorProcessor(ExpressionCompiler.java:85)
	at io.trino.sql.planner.LocalExecutionPlanner$Visitor.visitScanFilterAndProject(LocalExecutionPlanner.java:2003)
	... 73 more
Caused by: com.google.common.base.VerifyException: break target does not exist
	at com.google.common.base.Verify.verify(Verify.java:126)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBreak(SqlRoutineCompiler.java:374)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBreak(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrBreak.accept(IrBreak.java:29)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBlock(SqlRoutineCompiler.java:343)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBlock(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrBlock.accept(IrBlock.java:41)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.lambda$visitLoop$2(SqlRoutineCompiler.java:420)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.compileLoop(SqlRoutineCompiler.java:447)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitLoop(SqlRoutineCompiler.java:416)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitLoop(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrLoop.accept(IrLoop.java:32)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBlock(SqlRoutineCompiler.java:343)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitBlock(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrBlock.accept(IrBlock.java:41)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitRoutine(SqlRoutineCompiler.java:312)
	at io.trino.sql.routine.SqlRoutineCompiler$BytecodeVisitor.visitRoutine(SqlRoutineCompiler.java:283)
	at io.trino.sql.routine.ir.IrRoutine.accept(IrRoutine.java:35)
	at io.trino.sql.routine.ir.IrNodeVisitor.process(IrNodeVisitor.java:20)
	at io.trino.sql.routine.SqlRoutineCompiler.generateRunMethod(SqlRoutineCompiler.java:230)
	at io.trino.sql.routine.SqlRoutineCompiler.compileClass(SqlRoutineCompiler.java:174)
	at io.trino.sql.routine.SqlRoutineCompiler.compile(SqlRoutineCompiler.java:135)
	at io.trino.metadata.WorkerLanguageFunctionProvider.specialize(WorkerLanguageFunctionProvider.java:57)
	at io.trino.metadata.FunctionManager.getScalarFunctionImplementationInternal(FunctionManager.java:108)
	at io.trino.metadata.FunctionManager.getScalarFunctionImplementation(FunctionManager.java:93)
	at io.trino.sql.gen.BytecodeUtils.lambda$generateFullInvocation$3(BytecodeUtils.java:219)
	at io.trino.sql.gen.BytecodeUtils.generateFullInvocation(BytecodeUtils.java:255)
	at io.trino.sql.gen.BytecodeUtils.generateFullInvocation(BytecodeUtils.java:212)
	at io.trino.sql.gen.BytecodeGeneratorContext.generateFullCall(BytecodeGeneratorContext.java:101)
	at io.trino.sql.gen.RowExpressionCompiler$Visitor.visitCall(RowExpressionCompiler.java:91)
	at io.trino.sql.gen.RowExpressionCompiler$Visitor.visitCall(RowExpressionCompiler.java:78)
	at io.trino.sql.relational.CallExpression.accept(CallExpression.java:93)
	at io.trino.sql.gen.RowExpressionCompiler.compile(RowExpressionCompiler.java:75)
	at io.trino.sql.gen.RowExpressionCompiler.compile(RowExpressionCompiler.java:70)
	at io.trino.sql.gen.CursorProcessorCompiler.generateProjectMethod(CursorProcessorCompiler.java:290)
	at io.trino.sql.gen.CursorProcessorCompiler.generateMethods(CursorProcessorCompiler.java:86)
	at io.trino.sql.gen.ExpressionCompiler.compileProcessor(ExpressionCompiler.java:157)
	at io.trino.sql.gen.ExpressionCompiler.compile(ExpressionCompiler.java:141)
	at io.trino.sql.gen.ExpressionCompiler.lambda$new$0(ExpressionCompiler.java:70)
	at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:169)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3576)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2318)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2191)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2081)
	... 80 more

@findepi findepi changed the title Function with loop fails with "break target does not exist" (unless executed on the coordinator) Function with loop fails with "Compiler failed: break target does not exist" (unless executed on the coordinator) Apr 24, 2024
@findepi findepi changed the title Function with loop fails with "Compiler failed: break target does not exist" (unless executed on the coordinator) Function with loop fails with "Compiler failed: break target does not exist" when runs on worker Apr 24, 2024
@findepi findepi changed the title Function with loop fails with "Compiler failed: break target does not exist" when runs on worker Function with LOOP fails with "Compiler failed [...] break target does not exist" when run on worker Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
1 participant