You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala> val df = Seq(Map("a" -> Tuple1(1))).toDF("a")
scala> df.write.mode("OVERWRITE").parquet("TEMP")
scala> val df2 = spark.read.parquet("TEMP")
df2: org.apache.spark.sql.DataFrame = [a: map<string,struct<_1:int>>]
scala> df2.select(to_json($"a")).show()
@Partitioning <SinglePartition$> could run on GPU
*Exec <ProjectExec> will run on GPU
*Expression <Alias> to_json(a#24, Some(UTC)) AS to_json(a)#30 will run on GPU
*Expression <StructsToJson> to_json(a#24, Some(UTC)) will run on GPU
*Exec <FileSourceScanExec> will run on GPU
...
24/05/25 04:59:58 ERROR Executor: Exception in task 0.0 in stage 7.0 (TID 7)
java.lang.ClassCastException: org.apache.spark.sql.types.MapType cannot be cast to org.apache.spark.sql.types.StructType
at org.apache.spark.sql.rapids.GpuStructsToJson.doColumnar(GpuStructsToJson.scala:86)
at com.nvidia.spark.rapids.GpuUnaryExpression.doItColumnar(GpuExpressions.scala:250)
at com.nvidia.spark.rapids.GpuUnaryExpression.$anonfun$columnarEval$1(GpuExpressions.scala:261)
at com.nvidia.spark.rapids.Arm$.withResource(Arm.scala:30)
at com.nvidia.spark.rapids.GpuUnaryExpression.columnarEval(GpuExpressions.scala:260)
at com.nvidia.spark.rapids.RapidsPluginImplicits$ReallyAGpuExpression.columnarEval(implicits.scala:35)
at com.nvidia.spark.rapids.GpuAlias.columnarEval(namedExpressions.scala:110)
at com.nvidia.spark.rapids.RapidsPluginImplicits$ReallyAGpuExpression.columnarEval(implicits.scala:35)
at com.nvidia.spark.rapids.GpuProjectExec$.$anonfun$project$1(basicPhysicalOperators.scala:110)
at com.nvidia.spark.rapids.RapidsPluginImplicits$MapsSafely.$anonfun$safeMap$1(implicits.scala:221)
at com.nvidia.spark.rapids.RapidsPluginImplicits$MapsSafely.$anonfun$safeMap$1$adapted(implicits.scala:218)
...
The text was updated successfully, but these errors were encountered:
Feng-Jiang28
changed the title
to_json - map
Converting a column containing a Map into json throws an exception:
May 25, 2024
Feng-Jiang28
changed the title
Converting a column containing a Map into json throws an exception:
Converting a column containing a map into json throws an exception:
May 25, 2024
Feng-Jiang28
changed the title
Converting a column containing a map into json throws an exception:
Converting a column containing a map into json throws an exception
May 25, 2024
Converting a column containing a Map into json throws an exception:
Reproduce:
CPU:
GPU:
The text was updated successfully, but these errors were encountered: