You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/08/16 13:46:46 UTC

[GitHub] [incubator-doris] spaces-X commented on a change in pull request #6356: Support bitmap(binary) type in hive to import doris

spaces-X commented on a change in pull request #6356:
URL: https://github.com/apache/incubator-doris/pull/6356#discussion_r689552040



##########
File path: fe/spark-dpp/src/main/java/org/apache/doris/load/loadv2/dpp/ColumnParser.java
##########
@@ -71,14 +71,25 @@ public static ColumnParser create(EtlJobConfig.EtlColumn etlColumn) throws Spark
         }
     }
 
-    public abstract boolean parse(String value);
+    public abstract boolean parse(Object value);
+}
+
+class BinaryParser extends ColumnParser{
+    @Override
+    public boolean parse(Object value) {
+        try{
+            return value instanceof byte[];
+        }catch (NumberFormatException e) {
+            return false;
+        }
+    }
 }
 
 class TinyIntParser extends ColumnParser {
     @Override
-    public boolean parse(String value) {
+    public boolean parse(Object value) {
         try {
-            Byte.parseByte(value);
+            Byte.parseByte(value.toString());

Review comment:
       NumberFormatException is included but NPE will not catched in this situation.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org