[ 
https://issues.apache.org/jira/browse/SPARK-56134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chenhao Li updated SPARK-56134:
-------------------------------
    Description: 
This issue is very similar to https://issues.apache.org/jira/browse/SPARK-23598

```

java.lang.IllegalAccessError: class 
org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1$filter_NestedClass_0
 tried to access protected field 
org.apache.spark.sql.execution.BufferedRowIterator.unsafeRow 
(org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1$filter_NestedClass_0
 is in unnamed module of loader 
org.codehaus.commons.compiler.util.reflect.ByteArrayClassLoader @4a3e356a; 
org.apache.spark.sql.execution.BufferedRowIterator is in unnamed module of 
loader 'app')

 at 
org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1$filter_NestedClass_0.wholestagecodegen_doConsume_0$(Unknown
 Source)

 at 
org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1$filter_NestedClass_0.locallimit_doConsume_0$(Unknown
 Source)

 at 
org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1.processNext(Unknown
 Source)

 at 
org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)

 at 
org.apache.spark.sql.execution.WholeStageCodegenEvaluatorFactory$WholeStageCodegenPartitionEvaluator$$anon$1.hasNext(WholeStageCodegenEvaluatorFactory.scala:50)

```

The root cause is that a nested class is generated after the code body gets too 
large. It will access `BufferedRowIterator.unsafeRow`. The generated code can 
pass compilation, but will trigger an IllegalAccessError during execution.

  was:
This issue is very similar to https://issues.apache.org/jira/browse/SPARK-23598

The root cause is that a nested class is generated after the code body gets too 
large. It will access `BufferedRowIterator.unsafeRow`. The generated code can 
pass compilation, but will trigger an IllegalAccessError during execution.


> WholeStageCodegen can lead to IllegalAccessError when accessing unsafeRow
> -------------------------------------------------------------------------
>
>                 Key: SPARK-56134
>                 URL: https://issues.apache.org/jira/browse/SPARK-56134
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 4.1.1
>            Reporter: Chenhao Li
>            Priority: Major
>
> This issue is very similar to 
> https://issues.apache.org/jira/browse/SPARK-23598
> ```
> java.lang.IllegalAccessError: class 
> org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1$filter_NestedClass_0
>  tried to access protected field 
> org.apache.spark.sql.execution.BufferedRowIterator.unsafeRow 
> (org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1$filter_NestedClass_0
>  is in unnamed module of loader 
> org.codehaus.commons.compiler.util.reflect.ByteArrayClassLoader @4a3e356a; 
> org.apache.spark.sql.execution.BufferedRowIterator is in unnamed module of 
> loader 'app')
>  at 
> org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1$filter_NestedClass_0.wholestagecodegen_doConsume_0$(Unknown
>  Source)
>  at 
> org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1$filter_NestedClass_0.locallimit_doConsume_0$(Unknown
>  Source)
>  at 
> org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIteratorForCodegenStage1.processNext(Unknown
>  Source)
>  at 
> org.apache.spark.sql.execution.BufferedRowIterator.hasNext(BufferedRowIterator.java:43)
>  at 
> org.apache.spark.sql.execution.WholeStageCodegenEvaluatorFactory$WholeStageCodegenPartitionEvaluator$$anon$1.hasNext(WholeStageCodegenEvaluatorFactory.scala:50)
> ```
> The root cause is that a nested class is generated after the code body gets 
> too large. It will access `BufferedRowIterator.unsafeRow`. The generated code 
> can pass compilation, but will trigger an IllegalAccessError during execution.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to