Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ExpressionEncoder does not work for input in GpuScalaUDF #3924

Closed
firestarman opened this issue Oct 26, 2021 · 3 comments
Closed

[BUG] ExpressionEncoder does not work for input in GpuScalaUDF #3924

firestarman opened this issue Oct 26, 2021 · 3 comments
Labels
bug Something isn't working P1 Nice to have for release

Comments

@firestarman
Copy link
Collaborator

firestarman commented Oct 26, 2021

Describe the bug
It complains the below errors when enabling ExpressionEncoder to do conversions for inputs of an UDF.

  Cause: java.lang.RuntimeException: Error while decoding: org.apache.spark.sql.catalyst.analysis.UnresolvedException: Invalid call to nullable on unresolved object, tree: getcolumnbyordinal(0, ShortType)
staticinvoke(class java.lang.Short, ObjectType(class java.lang.Short), valueOf, upcast(getcolumnbyordinal(0, ShortType), ShortType, - root class: "java.lang.Short"), true, false)
  at org.apache.spark.sql.catalyst.encoders.ExpressionEncoder$Deserializer.apply(ExpressionEncoder.scala:188)
  at org.apache.spark.sql.rapids.GpuScalaUDF.$anonfun$scalaConverter$2(GpuScalaUDF.scala:108)
  at org.apache.spark.sql.rapids.GpuScalaUDF.$anonfun$childAccessors$2(GpuScalaUDF.scala:141)
  at org.apache.spark.sql.rapids.GpuScalaUDF.$anonfun$argsParser$2(GpuScalaUDF.scala:145)
  at org.apache.spark.sql.rapids.GpuScalaUDF.$anonfun$argsParser$2$adapted(GpuScalaUDF.scala:145)
  at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:237)
  at scala.collection.immutable.Range.foreach(Range.scala:158)
  at scala.collection.TraversableLike.map(TraversableLike.scala:237)
  at scala.collection.TraversableLike.map$(TraversableLike.scala:230)
  at scala.collection.AbstractTraversable.map(Traversable.scala:108)
  ...
  Cause: org.apache.spark.sql.catalyst.analysis.UnresolvedException: Invalid call to nullable on unresolved object, tree: null
  at org.apache.spark.sql.catalyst.analysis.GetColumnByOrdinal.nullable(unresolved.scala:520)
  at org.apache.spark.sql.catalyst.expressions.UnaryExpression.nullable(Expression.scala:450)
  at org.apache.spark.sql.catalyst.expressions.objects.InvokeLike.$anonfun$needNullCheck$1(objects.scala:48)
  at org.apache.spark.sql.catalyst.expressions.objects.InvokeLike.$anonfun$needNullCheck$1$adapted(objects.scala:48)
  at scala.collection.LinearSeqOptimized.exists(LinearSeqOptimized.scala:95)
  at scala.collection.LinearSeqOptimized.exists$(LinearSeqOptimized.scala:92)
  at scala.collection.immutable.List.exists(List.scala:89)
  at org.apache.spark.sql.catalyst.expressions.objects.InvokeLike.needNullCheck(objects.scala:48)
  at org.apache.spark.sql.catalyst.expressions.objects.InvokeLike.needNullCheck$(objects.scala:48)
  at org.apache.spark.sql.catalyst.expressions.objects.StaticInvoke.needNullCheck$lzycompute(objects.scala:211)

This is a follow on issue for #3897 .

Steps/Code to reproduce bug
Enable the encoder and run the tests as below
mvn clean test -nsu -DwildcardSuites="com.nvidia.spark.rapids.CPUBasedUDFSuite"

This is low priority since we can use CatalystTypeConverters to do the same things, and it is good enough for cudf supported types.

@firestarman firestarman added bug Something isn't working ? - Needs Triage Need team to review and classify P1 Nice to have for release labels Oct 26, 2021
@Salonijain27 Salonijain27 removed the ? - Needs Triage Need team to review and classify label Oct 26, 2021
@Salonijain27 Salonijain27 removed the P1 Nice to have for release label Oct 26, 2021
@firestarman
Copy link
Collaborator Author

This is low priority since we can use CatalystTypeConverters to do the same things, and it is good enough for cudf supported types. Added P2 tag.

@firestarman firestarman added the P1 Nice to have for release label Oct 27, 2021
@firestarman
Copy link
Collaborator Author

firestarman commented Oct 27, 2021

Here is a related issue #3855

@firestarman
Copy link
Collaborator Author

firestarman commented Oct 28, 2021

The code for input type conversion is changed a lot from Spark 3.0 to 3.1+.

This error happened when running the 3.1+ code under Spark 3.0. So it dismisses after changing to use the 3.0 code now.

Close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 Nice to have for release
Projects
None yet
Development

No branches or pull requests

2 participants