This is an automated email from the ASF dual-hosted git repository.
leesf pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git
The following commit(s) were added to refs/heads/master by this push:
new 5e5c177e4b [HUDI-3923] Fix cast exception while reading boolean type
of partitioned field (#5373)
5e5c177e4b is described below
commit 5e5c177e4b95d73e95cb89e9c03665a9a69a631a
Author: miomiocat <[email protected]>
AuthorDate: Sat Apr 23 20:12:54 2022 +0800
[HUDI-3923] Fix cast exception while reading boolean type of partitioned
field (#5373)
---
.../spark/sql/execution/datasources/Spark3ParsePartitionUtil.scala | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/execution/datasources/Spark3ParsePartitionUtil.scala
b/hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/execution/datasources/Spark3ParsePartitionUtil.scala
index 6f29053aef..f0cbe0530f 100644
---
a/hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/execution/datasources/Spark3ParsePartitionUtil.scala
+++
b/hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/execution/datasources/Spark3ParsePartitionUtil.scala
@@ -17,7 +17,7 @@
package org.apache.spark.sql.execution.datasources
-import java.lang.{Double => JDouble, Long => JLong}
+import java.lang.{Boolean => JBoolean, Double => JDouble, Long => JLong}
import java.math.{BigDecimal => JBigDecimal}
import java.time.ZoneId
import java.util.{Locale, TimeZone}
@@ -253,6 +253,7 @@ class Spark3ParsePartitionUtil(conf: SQLConf) extends
SparkParsePartitionUtil {
zoneId: ZoneId): Any = desiredType match {
case _ if value == DEFAULT_PARTITION_PATH => null
case NullType => null
+ case BooleanType => JBoolean.parseBoolean(value)
case StringType => UTF8String.fromString(unescapePathName(value))
case IntegerType => Integer.parseInt(value)
case LongType => JLong.parseLong(value)