dongjoon-hyun commented on pull request #31709:
URL: https://github.com/apache/spark/pull/31709#issuecomment-790125366


   The fix seems to be applicable, but the test seems to fail unfortunately.
   ```
   $ git diff HEAD~1
   diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
   index 3189e6841a..ba9e9ecebb 100644
   --- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
   +++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
   @@ -487,7 +487,7 @@ case class NewInstance(
        ev.isNull = resultIsNull
   
        val constructorCall = outer.map { gen =>
   -      s"${gen.value}.new ${cls.getSimpleName}($argString)"
   +      s"${gen.value}.new ${Utils.getSimpleName(cls)}($argString)"
        }.getOrElse {
          s"new $className($argString)"
        }
   ```
   
   ```
   [info] - encode/decode for nested Scala class should work: 
MalformedNameExample(42) (codegen path) *** FAILED *** (34 milliseconds)
   [info]   Exception thrown while decoding
   [info]   Converted: [0,2a]
   [info]   Schema: x#836
   [info]   root
   [info]   -- x: integer (nullable = false)
   [info]
   [info]
   [info]   Encoder:
   [info]   class[x[0]: int] (ExpressionEncoderSuite.scala:399)
   [info]   org.scalatest.exceptions.TestFailedException:
   [info]   at 
org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:528)
   [info]   at 
org.scalatest.FunSuite.newAssertionFailedException(FunSuite.scala:1560)
   [info]   at org.scalatest.Assertions$class.fail(Assertions.scala:1105)
   [info]   at org.scalatest.FunSuite.fail(FunSuite.scala:1560)
   [info]   at 
org.apache.spark.sql.catalyst.encoders.ExpressionEncoderSuite$$anonfun$encodeDecodeTest$1.apply(ExpressionEncoderSuite.scala:399)
   [info]   at 
org.apache.spark.sql.catalyst.encoders.ExpressionEncoderSuite.org$apache$spark$sql$catalyst$encoders$ExpressionEncoderSuite$$verifyNotLeakingReflectionObjects(ExpressionEncoderSuite.scala:477)
   [info]   at 
org.apache.spark.sql.catalyst.encoders.ExpressionEncoderSuite$$anonfun$testAndVerifyNotLeakingReflectionObjects$1.apply(ExpressionEncoderSuite.scala:484)
   
   ...
   
   [info]   Cause: java.lang.RuntimeException: Error while decoding: 
java.util.concurrent.ExecutionException: 
org.codehaus.commons.compiler.CompileException: File 'generated.java', Line 32, 
Column 124: failed to compile: org.codehaus.commons.compiler.CompileException: 
File 'generated.java', Line 32, Column 124: 
"org.apache.spark.sql.catalyst.encoders.ExpressionEncoderSuite$MalformedClassObject$"
 has no member type 
"ExpressionEncoderSuite$MalformedClassObject$MalformedNameExample"
   [info] newInstance(class 
org.apache.spark.sql.catalyst.encoders.ExpressionEncoderSuite$MalformedClassObject$MalformedNameExample)
   [info]   at 
org.apache.spark.sql.catalyst.encoders.ExpressionEncoder.fromRow(ExpressionEncoder.scala:305)
   [info]   at 
org.apache.spark.sql.catalyst.encoders.ExpressionEncoderSuite$$anonfun$encodeDecodeTest$1.apply(ExpressionEncoderSuite.scala:397)
   ```


----------------------------------------------------------------
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