kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KYLIN-3547) DimensionRangeInfo: Unsupported data type boolean
Date Tue, 11 Sep 2018 10:06:00 GMT

    [ https://issues.apache.org/jira/browse/KYLIN-3547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16610387#comment-16610387
] 

ASF GitHub Bot commented on KYLIN-3547:
---------------------------------------

shaofengshi closed pull request #226: KYLIN-3547 add boolean DataTypeOrder
URL: https://github.com/apache/kylin/pull/226
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataType.java
b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataType.java
index 2fe1667cd5..7580ad0202 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataType.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataType.java
@@ -314,6 +314,10 @@ public boolean isDecimal() {
         return name.equals("decimal");
     }
 
+    public boolean isBoolean() {
+        return name.equals("boolean");
+    }
+
     public String getName() {
         return name;
     }
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataTypeOrder.java
b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataTypeOrder.java
index 091e2ae7e1..44921786d0 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataTypeOrder.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataTypeOrder.java
@@ -36,6 +36,7 @@
     public static final DataTypeOrder DECIMAL_ORDER = new DecimalOrder();
     public static final DataTypeOrder DATETIME_ORDER = new DateTimeOrder();
     public static final DataTypeOrder STRING_ORDER = new StringOrder();
+    public static final DataTypeOrder BOOLEAN_ORDER = new BooleanOrder();
 
     // package private, access via DataType.getOrder()
     static DataTypeOrder getInstance(DataType type) throws IllegalArgumentException {
@@ -49,6 +50,8 @@ else if (type.isFloat() || type.isDouble())
             return DOUBLE_ORDER;
         else if (type.isDecimal())
             return DECIMAL_ORDER;
+        else if (type.isBoolean())
+            return BOOLEAN_ORDER;
         else
             throw new IllegalArgumentException("Unsupported data type " + type);
     }
@@ -151,5 +154,11 @@ public Long toComparable(String s) {
                 return DateFormat.stringToMillis(s);
         }
     }
-    
+
+    private static class BooleanOrder extends DataTypeOrder {
+        @Override
+        public String toComparable(String s) {
+            return s;
+        }
+    }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> DimensionRangeInfo: Unsupported data type boolean
> -------------------------------------------------
>
>                 Key: KYLIN-3547
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3547
>             Project: Kylin
>          Issue Type: Bug
>          Components: Job Engine, Metadata
>    Affects Versions: v2.5.0
>            Reporter: Yichen Zhou
>            Assignee: Yichen Zhou
>            Priority: Blocker
>             Fix For: v2.5.0
>
>
> In Extract Fact Table Distinct Columns Step, Kylin can not get dimension range information
from data of boolean type because DataType.getOrder() does not support boolean.
> {quote}java.lang.RuntimeException: error execute org.apache.kylin.engine.spark.SparkFactDistinct
at org.apache.kylin.common.util.AbstractApplication.execute(AbstractApplication.java:42) at
org.apache.kylin.common.util.SparkEntry.main(SparkEntry.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:636)
Caused by: org.apache.spark.SparkException: Job aborted due to stage failure: Task 5 in stage
1.0 failed 4 times, most recent failure: Lost task 5.3 in stage 1.0 (TID 17, slave1.kcluster,
executor 5): java.lang.IllegalArgumentException: Unsupported data type boolean at org.apache.kylin.metadata.datatype.DataTypeOrder.getInstance(DataTypeOrder.java:53)
at org.apache.kylin.metadata.datatype.DataType.getOrder(DataType.java:230) at org.apache.kylin.metadata.datatype.DataType.compare(DataType.java:236)
at org.apache.kylin.engine.spark.SparkFactDistinct$MultiOutputFunction.call(SparkFactDistinct.java:739)
at org.apache.kylin.engine.spark.SparkFactDistinct$MultiOutputFunction.call(SparkFactDistinct.java:612)
at org.apache.spark.api.java.JavaRDDLike$$anonfun$fn$7$1.apply(JavaRDDLike.scala:186) at org.apache.spark.api.java.JavaRDDLike$$anonfun$fn$7$1.apply(JavaRDDLike.scala:186)
at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$23.apply(RDD.scala:797)
at org.apache.spark.rdd.RDD$$anonfun$mapPartitions$1$$anonfun$apply$23.apply(RDD.scala:797)
at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38) at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:287) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)
at org.apache.spark.scheduler.Task.run(Task.scala:99) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:325)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
> {quote}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message