KnightChess created HUDI-4910:
---------------------------------
Summary: Unknown variable or type "Cast" use spark merge into
Key: HUDI-4910
URL: https://issues.apache.org/jira/browse/HUDI-4910
Project: Apache Hudi
Issue Type: Bug
Components: spark-sql
Reporter: KnightChess
Assignee: KnightChess
when assigment expression has `cast string to float or double`, then code gen
will contain
{code:java}
final Double d = (Double) Cast.processFloatingPointSpecialLiterals(doubleStr_0,
false); {code}
`Cast` need to be import when comple, otherwise will throw exception
{code:java}
Exception in thread "main" org.codehaus.commons.compiler.CompileException: Line
25, Column 44: failed to compile:
org.codehaus.commons.compiler.CompileException: Line 25, Column 44: Unknown
variable or type "Cast" at
org.apache.spark.sql.hudi.command.payload.ExpressionCodeGen$.doCodeGen(ExpressionCodeGen.scala:138)
at
org.apache.spark.sql.hudi.command.MergeIntoHoodieTableCommand.$anonfun$executeUpsert$11(MergeIntoHoodieTableCommand.scala:324)
at
scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:237)
at scala.collection.immutable.Map$Map1.foreach(Map.scala:128) at
scala.collection.TraversableLike.map(TraversableLike.scala:237) at
scala.collection.TraversableLike.map$(TraversableLike.scala:230) at
scala.collection.AbstractTraversable.map(Traversable.scala:108) at
org.apache.spark.sql.hudi.command.MergeIntoHoodieTableCommand.executeUpsert(MergeIntoHoodieTableCommand.scala:314)
at
org.apache.spark.sql.hudi.command.MergeIntoHoodieTableCommand.run(MergeIntoHoodieTableCommand.scala:156)
at
org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:75)
at
org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:73)
at
org.apache.spark.sql.execution.command.ExecutedCommandExec.executeCollect(commands.scala:84)
at
org.apache.spark.sql.execution.QueryExecution$$anonfun$eagerlyExecuteCommands$1.$anonfun$applyOrElse$1(QueryExecution.scala:110)
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)