Summary
This article discusses how to resolve the SYSTEM ERROR: CompileException: File 'com.dremio.exec.compile.DremioJavaFileObject[MergerGen326.java]', Line 2907, Column 16: MergerGen326.java:2907: error: code too large error when running queries (including through PowerBI) that made use of a large number of ORDER BY columns.
Reported Issue
When attempting to run queries that made use of a large number of ORDER BY columns, these would fail in Dremio as well as through PowerBI with the below error.
SYSTEM ERROR: CompileException: File 'com.dremio.exec.compile.DremioJavaFileObject[MergerGen326.java]', Line 2907, Column 16: MergerGen326.java:2907: error: code too large
However running the same query with the ORDER BY clause in the Dremio UI would succeed albeit at a slower query time.
Relevant Versions
This issue applies to Dremio versions 25.2.2 and on wards.
Troubleshooting Steps
1. Navigate to the failing job profile as per the following documentation link steps: https://docs.dremio.com/current/sonar/monitoring/jobs/raw-profile/
2. After navigating to the "Raw Profile", click on the "Error" tab of the profile.
3. Confirm that the error is the same as mentioned in this article. As an example, the following error can be seen in the "Verbose" section of the "Error" tab of the job profile:
SYSTEM ERROR: CompileException: File 'com.dremio.exec.compile.DremioJavaFileObject[MergerGen326.java]', Line 2907, Column 16: MergerGen326.java:2907: error: code too large
public int doEval(int leftIndex, int rightIndex)
^ (compiler.err.limit.code)
SqlOperatorImpl MERGING_RECEIVER
Location 0:0:7
SqlOperatorImpl MERGING_RECEIVER
Location 0:0:7
ErrorOrigin: EXECUTOR
[Error Id: b22f401d-145e-43e1-9b56-29bfc98aa590 on LAPTOP-MJMBCBJM.:0]
(com.google.common.util.concurrent.UncheckedExecutionException) com.dremio.exec.exception.ClassTransformationException: Failure generating transformation classes.
com.google.common.cache.LocalCache$Segment.get():2085
com.google.common.cache.LocalCache.get():4017
com.google.common.cache.LocalCache.getOrLoad():4040
com.google.common.cache.LocalCache$LocalLoadingCache.get():4989
com.dremio.exec.compile.CodeCompiler.getImplementationClass():85
com.dremio.exec.compile.CodeCompiler.getImplementationClass():69
com.dremio.exec.expr.CodeGenerator.getImplementationClass():166
com.dremio.sabot.op.receiver.merging.MergingReceiverOperator.createMerger():243
com.dremio.sabot.op.receiver.merging.MergingReceiverOperator.setup():127
com.dremio.sabot.driver.SmartOp$SmartProducer.setup():638
com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():90
com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():70
com.dremio.sabot.driver.SmartOp$SmartProducer.accept():609
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.Pipeline.setup():79
com.dremio.sabot.exec.fragment.FragmentExecutor.setupExecution():770
com.dremio.sabot.exec.fragment.FragmentExecutor.run():549
com.dremio.sabot.exec.fragment.FragmentExecutor$AsyncTaskImpl.run():1274
com.dremio.sabot.task.AsyncTaskWrapper.run():130
com.dremio.sabot.task.slicing.SlicingThread.mainExecutionLoop():281
com.dremio.sabot.task.slicing.SlicingThread.run():186
Caused By (com.dremio.exec.exception.ClassTransformationException) Failure generating transformation classes.
com.dremio.exec.compile.ClassTransformer.getExtendedImplementationClass():218
com.dremio.exec.compile.ClassTransformer.getImplementationClass():175
com.dremio.exec.compile.CodeCompiler$GeneratedCodeToCompiledClazzCacheLoader.load():172
com.dremio.exec.compile.CodeCompiler$GeneratedCodeToCompiledClazzCacheLoader.load():165
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture():3574
com.google.common.cache.LocalCache$Segment.loadSync():2316
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad():2189
com.google.common.cache.LocalCache$Segment.get():2079
com.google.common.cache.LocalCache.get():4017
com.google.common.cache.LocalCache.getOrLoad():4040
com.google.common.cache.LocalCache$LocalLoadingCache.get():4989
com.dremio.exec.compile.CodeCompiler.getImplementationClass():85
com.dremio.exec.compile.CodeCompiler.getImplementationClass():69
com.dremio.exec.expr.CodeGenerator.getImplementationClass():166
com.dremio.sabot.op.receiver.merging.MergingReceiverOperator.createMerger():243
com.dremio.sabot.op.receiver.merging.MergingReceiverOperator.setup():127
com.dremio.sabot.driver.SmartOp$SmartProducer.setup():638
com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():90
com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():70
com.dremio.sabot.driver.SmartOp$SmartProducer.accept():609
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.Pipeline.setup():79
com.dremio.sabot.exec.fragment.FragmentExecutor.setupExecution():770
com.dremio.sabot.exec.fragment.FragmentExecutor.run():549
com.dremio.sabot.exec.fragment.FragmentExecutor$AsyncTaskImpl.run():1274
com.dremio.sabot.task.AsyncTaskWrapper.run():130
com.dremio.sabot.task.slicing.SlicingThread.mainExecutionLoop():281
com.dremio.sabot.task.slicing.SlicingThread.run():186
Caused By (org.codehaus.commons.compiler.CompileException) File 'com.dremio.exec.compile.DremioJavaFileObject[MergerGen326.java]', Line 2907, Column 16: MergerGen326.java:2907: error: code too large
public int doEval(int leftIndex, int rightIndex)
^ (compiler.err.limit.code)
com.dremio.exec.compile.DremioDiagnosticListener.report():42
com.sun.tools.javac.api.ClientCodeWrapper$WrappedDiagnosticListener.report():736
com.sun.tools.javac.util.Log.writeDiagnostic():734
com.sun.tools.javac.util.Log$DefaultDiagnosticHandler.report():718
com.sun.tools.javac.util.Log.report():678
com.sun.tools.javac.util.AbstractLog.error():116
com.sun.tools.javac.jvm.Code.checkLimits():99
com.sun.tools.javac.jvm.Gen.genMethod():939
com.sun.tools.javac.jvm.Gen.visitMethodDef():866
com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept():866
com.sun.tools.javac.jvm.Gen.genDef():597
com.sun.tools.javac.jvm.Gen.genClass():2202
com.sun.tools.javac.main.JavaCompiler.genCode():756
com.sun.tools.javac.main.JavaCompiler.generate():1631
com.sun.tools.javac.main.JavaCompiler.generate():1599
com.sun.tools.javac.main.JavaCompiler.compile():973
com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0():104
com.sun.tools.javac.api.JavacTaskImpl.handleExceptions():147
com.sun.tools.javac.api.JavacTaskImpl.doCall():100
com.sun.tools.javac.api.JavacTaskImpl.call():94
com.dremio.exec.compile.JDKClassCompiler.getByteCode():193
com.dremio.exec.compile.AbstractClassCompiler.getClassByteCode():49
com.dremio.exec.compile.ClassCompilerSelector.getClassByteCode():123
com.dremio.exec.compile.QueryClassLoader.getClassByteCode():65
com.dremio.exec.compile.ClassTransformer.getExtendedImplementationClass():191
com.dremio.exec.compile.ClassTransformer.getImplementationClass():175
com.dremio.exec.compile.CodeCompiler$GeneratedCodeToCompiledClazzCacheLoader.load():172
com.dremio.exec.compile.CodeCompiler$GeneratedCodeToCompiledClazzCacheLoader.load():165
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture():3574
com.google.common.cache.LocalCache$Segment.loadSync():2316
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad():2189
com.google.common.cache.LocalCache$Segment.get():2079
com.google.common.cache.LocalCache.get():4017
com.google.common.cache.LocalCache.getOrLoad():4040
com.google.common.cache.LocalCache$LocalLoadingCache.get():4989
com.dremio.exec.compile.CodeCompiler.getImplementationClass():85
com.dremio.exec.compile.CodeCompiler.getImplementationClass():69
com.dremio.exec.expr.CodeGenerator.getImplementationClass():166
com.dremio.sabot.op.receiver.merging.MergingReceiverOperator.createMerger():243
com.dremio.sabot.op.receiver.merging.MergingReceiverOperator.setup():127
com.dremio.sabot.driver.SmartOp$SmartProducer.setup():638
com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():90
com.dremio.sabot.driver.Pipe$SetupVisitor.visitProducer():70
com.dremio.sabot.driver.SmartOp$SmartProducer.accept():609
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.StraightPipe.setup():100
com.dremio.sabot.driver.Pipeline.setup():79
com.dremio.sabot.exec.fragment.FragmentExecutor.setupExecution():770
com.dremio.sabot.exec.fragment.FragmentExecutor.run():549
com.dremio.sabot.exec.fragment.FragmentExecutor$AsyncTaskImpl.run():1274
com.dremio.sabot.task.AsyncTaskWrapper.run():130
com.dremio.sabot.task.slicing.SlicingThread.mainExecutionLoop():281
com.dremio.sabot.task.slicing.SlicingThread.run():186
4. Carry out the "Steps to Resolve" described below.
Cause
Queries that made use of a large number of ORDER BY columns caused a CompileException.
Steps to Resolve
Upgrade to Dremio v25.2.6 or higher.
Additional Resources
Viewing a Raw Profile: https://docs.dremio.com/current/sonar/monitoring/jobs/raw-profile/
v25.2.6 Release Notes: https://docs.dremio.com/current/release-notes/version-250-release#2526-march-2025