LuciferYang opened a new pull request #29903:
URL: https://github.com/apache/spark/pull/29903


   ### What changes were proposed in this pull request?
   After `SPARK-32851` set `CODEGEN_FACTORY_MODE` to `CODEGEN_ONLY` of 
`sparkConf` in `SharedSparkSessionBase`  to construction `SparkSession`  in 
test, the test suite `SPARK-32459: UDF should not fail on WrappedArray` in 
s.sql.UDFSuite exposed a codegen fallback issue in Scala 2.13 as follow:
   
   ```
   - SPARK-32459: UDF should not fail on WrappedArray *** FAILED ***
   Caused by: org.codehaus.commons.compiler.CompileException: File 
'generated.java', Line 47, Column 99: failed to compile: 
org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 47, 
Column 99: No applicable constructor/method found for zero actual parameters; 
candidates are: "public scala.collection.mutable.Builder 
scala.collection.mutable.ArraySeq$.newBuilder(java.lang.Object)", "public 
scala.collection.mutable.Builder 
scala.collection.mutable.ArraySeq$.newBuilder(scala.reflect.ClassTag)", "public 
abstract scala.collection.mutable.Builder 
scala.collection.EvidenceIterableFactory.newBuilder(java.lang.Object)"
   ```
   
   The root cause is `WrappedArray` represent `mutable.ArraySeq`  in Scala 2.13 
and has a different constructor of `newBuilder` method.
   
   The main change of is pr is add Scala 2.13 only code part to deal with  
`case match WrappedArray` in Scala 2.13.
    
   ### Why are the changes needed?
   We need to support a Scala 2.13 build
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   - Scala 2.12: Pass the Jenkins or GitHub Action
   
   - Scala 2.13: All tests passed.
   
   Do the following:
   
   ```
   dev/change-scala-version.sh 2.13
   mvn clean install -DskipTests  -pl sql/core -Pscala-2.13 -am
   mvn test -pl sql/core -Pscala-2.13
   ```
   
   **Before**
   ```
   Tests: succeeded 8540, failed 1, canceled 1, ignored 52, pending 0
   *** 1 TEST FAILED ***
   
   ```
   
   **After**
   
   ```
   Tests: succeeded 8541, failed 0, canceled 1, ignored 52, pending 0
   All tests passed.
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to