Skip to content

Instantly share code, notes, and snippets.

@c21
Created May 11, 2021 06:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save c21/196166411d5d0406d9a76b37be889194 to your computer and use it in GitHub Desktop.
Save c21/196166411d5d0406d9a76b37be889194 to your computer and use it in GitHub Desktop.
Unreachable exception
23:03:27.182 ERROR org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator: failed to compile: org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 99, Column 86: Statement is unreachable
org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 99, Column 86: Statement is unreachable
at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:12021)
at org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1570)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3420)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1362)
at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1335)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:807)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:975)
at org.codehaus.janino.UnitCompiler.access$700(UnitCompiler.java:226)
at org.codehaus.janino.UnitCompiler$2.visitMemberClassDeclaration(UnitCompiler.java:392)
at org.codehaus.janino.UnitCompiler$2.visitMemberClassDeclaration(UnitCompiler.java:384)
at org.codehaus.janino.Java$MemberClassDeclaration.accept(Java.java:1445)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:384)
at org.codehaus.janino.UnitCompiler.compileDeclaredMemberTypes(UnitCompiler.java:1312)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:833)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:410)
at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:226)
at org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:389)
at org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:384)
at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:1594)
at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:384)
at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:362)
at org.codehaus.janino.UnitCompiler.access$000(UnitCompiler.java:226)
at org.codehaus.janino.UnitCompiler$1.visitCompilationUnit(UnitCompiler.java:336)
at org.codehaus.janino.UnitCompiler$1.visitCompilationUnit(UnitCompiler.java:333)
at org.codehaus.janino.Java$CompilationUnit.accept(Java.java:363)
at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:333)
at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:235)
at org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java:464)
at org.codehaus.janino.ClassBodyEvaluator.compileToClass(ClassBodyEvaluator.java:314)
at org.codehaus.janino.ClassBodyEvaluator.cook(ClassBodyEvaluator.java:237)
at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:205)
at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:80)
at org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator$.org$apache$spark$sql$catalyst$expressions$codegen$CodeGenerator$$doCompile(CodeGenerator.scala:1402)
at org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator$$anon$1.load(CodeGenerator.scala:1499)
at org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator$$anon$1.load(CodeGenerator.scala:1496)
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3599)
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2379)
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2342)
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2257)
at com.google.common.cache.LocalCache.get(LocalCache.java:4000)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4004)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4874)
at org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator$.compile(CodeGenerator.scala:1349)
at org.apache.spark.sql.execution.WholeStageCodegenExec.liftedTree1$1(WholeStageCodegenExec.scala:725)
at org.apache.spark.sql.execution.WholeStageCodegenExec.doExecute(WholeStageCodegenExec.scala:724)
at org.apache.spark.sql.execution.SparkPlan.$anonfun$execute$1(SparkPlan.scala:179)
at org.apache.spark.sql.execution.SparkPlan.$anonfun$executeQuery$1(SparkPlan.scala:217)
at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:151)
at org.apache.spark.sql.execution.SparkPlan.executeQuery(SparkPlan.scala:214)
at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:175)
at org.apache.spark.sql.execution.SparkPlan.getByteArrayRdd(SparkPlan.scala:320)
at org.apache.spark.sql.execution.SparkPlan.executeCollect(SparkPlan.scala:386)
at org.apache.spark.sql.execution.SparkPlan.executeCollectPublic(SparkPlan.scala:416)
at org.apache.spark.sql.execution.SparkPlanTest$.executePlan(SparkPlanTest.scala:251)
at org.apache.spark.sql.execution.SparkPlanTest$.checkAnswer(SparkPlanTest.scala:211)
at org.apache.spark.sql.execution.SparkPlanTest.doCheckAnswer(SparkPlanTest.scala:94)
at org.apache.spark.sql.execution.SparkPlanTest.checkAnswer2(SparkPlanTest.scala:76)
at org.apache.spark.sql.execution.joins.InnerJoinSuite.$anonfun$testInnerJoin$25(InnerJoinSuite.scala:186)
at org.apache.spark.sql.catalyst.plans.SQLHelper.withSQLConf(SQLHelper.scala:54)
at org.apache.spark.sql.catalyst.plans.SQLHelper.withSQLConf$(SQLHelper.scala:38)
at org.apache.spark.sql.execution.joins.InnerJoinSuite.org$apache$spark$sql$test$SQLTestUtilsBase$$super$withSQLConf(InnerJoinSuite.scala:32)
at org.apache.spark.sql.test.SQLTestUtilsBase.withSQLConf(SQLTestUtils.scala:246)
at org.apache.spark.sql.test.SQLTestUtilsBase.withSQLConf$(SQLTestUtils.scala:244)
at org.apache.spark.sql.execution.joins.InnerJoinSuite.withSQLConf(InnerJoinSuite.scala:32)
at org.apache.spark.sql.execution.joins.InnerJoinSuite.$anonfun$testInnerJoin$24(InnerJoinSuite.scala:183)
at org.apache.spark.sql.execution.joins.InnerJoinSuite.$anonfun$testInnerJoin$24$adapted(InnerJoinSuite.scala:181)
at scala.Option.foreach(Option.scala:407)
at org.apache.spark.sql.execution.joins.InnerJoinSuite.$anonfun$testInnerJoin$23(InnerJoinSuite.scala:181)
at org.apache.spark.sql.execution.joins.InnerJoinSuite.$anonfun$testInnerJoin$23$adapted(InnerJoinSuite.scala:180)
at org.apache.spark.sql.test.SQLTestUtils.$anonfun$testWithWholeStageCodegenOnAndOff$3(SQLTestUtils.scala:91)
at org.apache.spark.sql.catalyst.plans.SQLHelper.withSQLConf(SQLHelper.scala:54)
at org.apache.spark.sql.catalyst.plans.SQLHelper.withSQLConf$(SQLHelper.scala:38)
at org.apache.spark.sql.execution.joins.InnerJoinSuite.org$apache$spark$sql$test$SQLTestUtilsBase$$super$withSQLConf(InnerJoinSuite.scala:32)
at org.apache.spark.sql.test.SQLTestUtilsBase.withSQLConf(SQLTestUtils.scala:246)
at org.apache.spark.sql.test.SQLTestUtilsBase.withSQLConf$(SQLTestUtils.scala:244)
at org.apache.spark.sql.execution.joins.InnerJoinSuite.withSQLConf(InnerJoinSuite.scala:32)
at org.apache.spark.sql.test.SQLTestUtils.$anonfun$testWithWholeStageCodegenOnAndOff$2(SQLTestUtils.scala:91)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at org.scalatest.OutcomeOf.outcomeOf(OutcomeOf.scala:85)
at org.scalatest.OutcomeOf.outcomeOf$(OutcomeOf.scala:83)
at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
at org.scalatest.Transformer.apply(Transformer.scala:22)
at org.scalatest.Transformer.apply(Transformer.scala:20)
at org.scalatest.funsuite.AnyFunSuiteLike$$anon$1.apply(AnyFunSuiteLike.scala:190)
at org.apache.spark.SparkFunSuite.withFixture(SparkFunSuite.scala:178)
at org.scalatest.funsuite.AnyFunSuiteLike.invokeWithFixture$1(AnyFunSuiteLike.scala:188)
at org.scalatest.funsuite.AnyFunSuiteLike.$anonfun$runTest$1(AnyFunSuiteLike.scala:200)
at org.scalatest.SuperEngine.runTestImpl(Engine.scala:306)
at org.scalatest.funsuite.AnyFunSuiteLike.runTest(AnyFunSuiteLike.scala:200)
at org.scalatest.funsuite.AnyFunSuiteLike.runTest$(AnyFunSuiteLike.scala:182)
at org.apache.spark.SparkFunSuite.org$scalatest$BeforeAndAfterEach$$super$runTest(SparkFunSuite.scala:61)
at org.scalatest.BeforeAndAfterEach.runTest(BeforeAndAfterEach.scala:234)
at org.scalatest.BeforeAndAfterEach.runTest$(BeforeAndAfterEach.scala:227)
at org.apache.spark.SparkFunSuite.runTest(SparkFunSuite.scala:61)
at org.scalatest.funsuite.AnyFunSuiteLike.$anonfun$runTests$1(AnyFunSuiteLike.scala:233)
at org.scalatest.SuperEngine.$anonfun$runTestsInBranch$1(Engine.scala:413)
at scala.collection.immutable.List.foreach(List.scala:392)
at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:401)
at org.scalatest.SuperEngine.runTestsInBranch(Engine.scala:396)
at org.scalatest.SuperEngine.runTestsImpl(Engine.scala:475)
at org.scalatest.funsuite.AnyFunSuiteLike.runTests(AnyFunSuiteLike.scala:233)
at org.scalatest.funsuite.AnyFunSuiteLike.runTests$(AnyFunSuiteLike.scala:232)
at org.scalatest.funsuite.AnyFunSuite.runTests(AnyFunSuite.scala:1563)
at org.scalatest.Suite.run(Suite.scala:1112)
at org.scalatest.Suite.run$(Suite.scala:1094)
at org.scalatest.funsuite.AnyFunSuite.org$scalatest$funsuite$AnyFunSuiteLike$$super$run(AnyFunSuite.scala:1563)
at org.scalatest.funsuite.AnyFunSuiteLike.$anonfun$run$1(AnyFunSuiteLike.scala:237)
at org.scalatest.SuperEngine.runImpl(Engine.scala:535)
at org.scalatest.funsuite.AnyFunSuiteLike.run(AnyFunSuiteLike.scala:237)
at org.scalatest.funsuite.AnyFunSuiteLike.run$(AnyFunSuiteLike.scala:236)
at org.apache.spark.SparkFunSuite.org$scalatest$BeforeAndAfterAll$$super$run(SparkFunSuite.scala:61)
at org.scalatest.BeforeAndAfterAll.liftedTree1$1(BeforeAndAfterAll.scala:213)
at org.scalatest.BeforeAndAfterAll.run(BeforeAndAfterAll.scala:210)
at org.scalatest.BeforeAndAfterAll.run$(BeforeAndAfterAll.scala:208)
at org.apache.spark.SparkFunSuite.run(SparkFunSuite.scala:61)
at org.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:45)
at org.scalatest.tools.Runner$.$anonfun$doRunRunRunDaDoRunRun$13(Runner.scala:1320)
at org.scalatest.tools.Runner$.$anonfun$doRunRunRunDaDoRunRun$13$adapted(Runner.scala:1314)
at scala.collection.immutable.List.foreach(List.scala:392)
at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:1314)
at org.scalatest.tools.Runner$.$anonfun$runOptionallyWithPassFailReporter$24(Runner.scala:993)
at org.scalatest.tools.Runner$.$anonfun$runOptionallyWithPassFailReporter$24$adapted(Runner.scala:971)
at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:1480)
at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:971)
at org.scalatest.tools.Runner$.run(Runner.scala:798)
at org.scalatest.tools.Runner.run(Runner.scala)
at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest2(ScalaTestRunner.java:133)
at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:27)
23:03:27.195 ERROR org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator:
/* 001 */ public Object generate(Object[] references) {
/* 002 */ return new GeneratedIteratorForCodegenStage5(references);
/* 003 */ }
/* 004 */
/* 005 */ // codegenStageId=5
/* 006 */ final class GeneratedIteratorForCodegenStage5 extends org.apache.spark.sql.execution.BufferedRowIterator {
/* 007 */ private Object[] references;
/* 008 */ private scala.collection.Iterator[] inputs;
/* 009 */ private scala.collection.Iterator smj_streamedInput_0;
/* 010 */ private scala.collection.Iterator smj_bufferedInput_0;
/* 011 */ private InternalRow smj_streamedRow_0;
/* 012 */ private InternalRow smj_bufferedRow_0;
/* 013 */ private int smj_value_2;
/* 014 */ private org.apache.spark.sql.execution.ExternalAppendOnlyUnsafeRowArray smj_matches_0;
/* 015 */ private int smj_value_3;
/* 016 */ private org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[] smj_mutableStateArray_0 = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter[1];
/* 017 */
/* 018 */ public GeneratedIteratorForCodegenStage5(Object[] references) {
/* 019 */ this.references = references;
/* 020 */ }
/* 021 */
/* 022 */ public void init(int index, scala.collection.Iterator[] inputs) {
/* 023 */ partitionIndex = index;
/* 024 */ this.inputs = inputs;
/* 025 */ smj_streamedInput_0 = inputs[0];
/* 026 */ smj_bufferedInput_0 = inputs[1];
/* 027 */
/* 028 */ smj_matches_0 = new org.apache.spark.sql.execution.ExternalAppendOnlyUnsafeRowArray(2147483632, 2147483647);
/* 029 */ smj_mutableStateArray_0[0] = new org.apache.spark.sql.catalyst.expressions.codegen.UnsafeRowWriter(4, 64);
/* 030 */
/* 031 */ }
/* 032 */
/* 033 */ private boolean findNextJoinRows(
/* 034 */ scala.collection.Iterator streamedIter,
/* 035 */ scala.collection.Iterator bufferedIter) {
/* 036 */ smj_streamedRow_0 = null;
/* 037 */ int comp = 0;
/* 038 */ while (smj_streamedRow_0 == null) {
/* 039 */ if (!streamedIter.hasNext()) return false;
/* 040 */ smj_streamedRow_0 = (InternalRow) streamedIter.next();
/* 041 */ boolean smj_isNull_0 = smj_streamedRow_0.isNullAt(0);
/* 042 */ int smj_value_0 = smj_isNull_0 ?
/* 043 */ -1 : (smj_streamedRow_0.getInt(0));
/* 044 */ if (smj_isNull_0) {
/* 045 */ smj_streamedRow_0 = null;
/* 046 */ continue;
/* 047 */
/* 048 */ }
/* 049 */ if (!smj_matches_0.isEmpty()) {
/* 050 */ comp = 0;
/* 051 */ if (comp == 0) {
/* 052 */ comp = (smj_value_0 > smj_value_3 ? 1 : smj_value_0 < smj_value_3 ? -1 : 0);
/* 053 */ }
/* 054 */
/* 055 */ if (comp == 0) {
/* 056 */ return true;
/* 057 */ }
/* 058 */ smj_matches_0.clear();
/* 059 */ }
/* 060 */
/* 061 */ do {
/* 062 */ if (smj_bufferedRow_0 == null) {
/* 063 */ if (!bufferedIter.hasNext()) {
/* 064 */ smj_value_3 = smj_value_0;
/* 065 */ return !smj_matches_0.isEmpty();
/* 066 */ }
/* 067 */ smj_bufferedRow_0 = (InternalRow) bufferedIter.next();
/* 068 */ boolean smj_isNull_1 = smj_bufferedRow_0.isNullAt(0);
/* 069 */ int smj_value_1 = smj_isNull_1 ?
/* 070 */ -1 : (smj_bufferedRow_0.getInt(0));
/* 071 */ if (smj_isNull_1) {
/* 072 */ smj_bufferedRow_0 = null;
/* 073 */ continue;
/* 074 */ }
/* 075 */ smj_value_2 = smj_value_1;
/* 076 */ }
/* 077 */
/* 078 */ comp = 0;
/* 079 */ if (comp == 0) {
/* 080 */ comp = (smj_value_0 > smj_value_2 ? 1 : smj_value_0 < smj_value_2 ? -1 : 0);
/* 081 */ }
/* 082 */
/* 083 */ if (comp > 0) {
/* 084 */ smj_bufferedRow_0 = null;
/* 085 */ } else if (comp < 0) {
/* 086 */ if (!smj_matches_0.isEmpty()) {
/* 087 */ smj_value_3 = smj_value_0;
/* 088 */ return true;
/* 089 */ } else {
/* 090 */ smj_streamedRow_0 = null;
/* 091 */ }
/* 092 */ } else {
/* 093 */ smj_matches_0.add((UnsafeRow) smj_bufferedRow_0);
/* 094 */ smj_bufferedRow_0 = null;
/* 095 */ }
/* 096 */ } while (smj_streamedRow_0 != null);
/* 097 */ }
/* 098 */
/* 099 */ throw new IllegalStateException("Executed unreachable code path in findNextJoinRows");
/* 100 */ return false;
/* 101 */ }
/* 102 */
/* 103 */ protected void processNext() throws java.io.IOException {
/* 104 */ while (findNextJoinRows(smj_streamedInput_0, smj_bufferedInput_0)) {
/* 105 */ boolean smj_isNull_2 = false;
/* 106 */ int smj_value_4 = -1;
/* 107 */
/* 108 */ boolean smj_isNull_3 = false;
/* 109 */ UTF8String smj_value_5 = null;
/* 110 */
/* 111 */ smj_isNull_2 = smj_streamedRow_0.isNullAt(0);
/* 112 */ smj_value_4 = smj_isNull_2 ? -1 : (smj_streamedRow_0.getInt(0));
/* 113 */ smj_isNull_3 = smj_streamedRow_0.isNullAt(1);
/* 114 */ smj_value_5 = smj_isNull_3 ? null : (smj_streamedRow_0.getUTF8String(1));
/* 115 */ scala.collection.Iterator<UnsafeRow> smj_iterator_0 = smj_matches_0.generateIterator();
/* 116 */ while (smj_iterator_0.hasNext()) {
/* 117 */ InternalRow smj_bufferedRow_1 = (InternalRow) smj_iterator_0.next();
/* 118 */
/* 119 */ ((org.apache.spark.sql.execution.metric.SQLMetric) references[0] /* numOutputRows */).add(1);
/* 120 */
/* 121 */ boolean smj_isNull_4 = smj_bufferedRow_1.isNullAt(0);
/* 122 */ int smj_value_6 = smj_isNull_4 ?
/* 123 */ -1 : (smj_bufferedRow_1.getInt(0));
/* 124 */ boolean smj_isNull_5 = smj_bufferedRow_1.isNullAt(1);
/* 125 */ UTF8String smj_value_7 = smj_isNull_5 ?
/* 126 */ null : (smj_bufferedRow_1.getUTF8String(1));
/* 127 */ smj_mutableStateArray_0[0].reset();
/* 128 */
/* 129 */ smj_mutableStateArray_0[0].zeroOutNullBytes();
/* 130 */
/* 131 */ if (smj_isNull_2) {
/* 132 */ smj_mutableStateArray_0[0].setNullAt(0);
/* 133 */ } else {
/* 134 */ smj_mutableStateArray_0[0].write(0, smj_value_4);
/* 135 */ }
/* 136 */
/* 137 */ if (smj_isNull_3) {
/* 138 */ smj_mutableStateArray_0[0].setNullAt(1);
/* 139 */ } else {
/* 140 */ smj_mutableStateArray_0[0].write(1, smj_value_5);
/* 141 */ }
/* 142 */
/* 143 */ if (smj_isNull_4) {
/* 144 */ smj_mutableStateArray_0[0].setNullAt(2);
/* 145 */ } else {
/* 146 */ smj_mutableStateArray_0[0].write(2, smj_value_6);
/* 147 */ }
/* 148 */
/* 149 */ if (smj_isNull_5) {
/* 150 */ smj_mutableStateArray_0[0].setNullAt(3);
/* 151 */ } else {
/* 152 */ smj_mutableStateArray_0[0].write(3, smj_value_7);
/* 153 */ }
/* 154 */ append((smj_mutableStateArray_0[0].getRow()).copy());
/* 155 */
/* 156 */ }
/* 157 */ if (shouldStop()) return;
/* 158 */ }
/* 159 */ ((org.apache.spark.sql.execution.joins.SortMergeJoinExec) references[1] /* plan */).cleanupResources();
/* 160 */ }
/* 161 */
/* 162 */ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment