This is an automated email from the ASF dual-hosted git repository.

xxyu pushed a commit to branch kylin-on-parquet-v2
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 399d25b23c112eaaa090b24ecbc332449dd1a4c1
Author: zhengshengjun <shengjun_zh...@sina.com>
AuthorDate: Mon Feb 22 17:29:52 2021 +0800

    KYLIN-4908 Segment pruner support integer partition col in spark query 
engine
---
 .../scala/org/apache/spark/sql/execution/datasource/FilePruner.scala  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/kylin-spark-project/kylin-spark-common/src/main/scala/org/apache/spark/sql/execution/datasource/FilePruner.scala
 
b/kylin-spark-project/kylin-spark-common/src/main/scala/org/apache/spark/sql/execution/datasource/FilePruner.scala
index 513b47f..f3fe76d 100644
--- 
a/kylin-spark-project/kylin-spark-common/src/main/scala/org/apache/spark/sql/execution/datasource/FilePruner.scala
+++ 
b/kylin-spark-project/kylin-spark-common/src/main/scala/org/apache/spark/sql/execution/datasource/FilePruner.scala
@@ -121,7 +121,7 @@ class FilePruner(cubeInstance: CubeInstance,
         // we can only get col ID in layout cuz data schema is all ids.
         val id = layoutEntity.getOrderedDimensions.asScala.values.find(
           column => column.columnName.equals(ref.getName))
-        if (id.isDefined && (ref.getType.isDateTimeFamily || 
ref.getType.isStringFamily)) {
+        if (id.isDefined && (ref.getType.isDateTimeFamily || 
ref.getType.isStringFamily || ref.getType.isIntegerFamily)) {
           pattern = desc.getPartitionDateFormat
           dataSchema.filter(_.name == String.valueOf(id.get.id))
         } else {
@@ -467,7 +467,7 @@ case class SegFilters(start: Long, end: Long, pattern: 
String) extends Logging {
         // see SPARK-27546
         val ts = DateFormat.stringToMillis(v.toString)
         func(ts)
-      case v: String if pattern != null =>
+      case v @ (_:String | _: Int | _: Long) if pattern != null =>
         val format = DateFormat.getDateFormat(pattern)
         val time = format.parse(v.toString).getTime
         func(time)

Reply via email to