You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@doris.apache.org by GitBox <gi...@apache.org> on 2018/11/28 06:24:09 UTC

[GitHub] chenhao7253886 commented on a change in pull request #359: Fix stream load failure when target table contains HLL and insert fai…

chenhao7253886 commented on a change in pull request #359: Fix stream load failure when target table contains HLL and insert fai…
URL: https://github.com/apache/incubator-doris/pull/359#discussion_r236952455
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/planner/StreamLoadScanNode.java
 ##########
 @@ -329,24 +329,13 @@ private void finalizeParams() throws UserException {
     }
 
     private Expr castToSlot(SlotDescriptor slotDesc, Expr expr) throws UserException {
-        if (slotDesc.getType().isNull()) {
-            return expr;
-        }
         PrimitiveType dstType = slotDesc.getType().getPrimitiveType();
         PrimitiveType srcType = expr.getType().getPrimitiveType();
-        if (dstType.isStringType()) {
-            if (srcType.isStringType()) {
-                return expr;
-            } else {
-                CastExpr castExpr = (CastExpr)expr.castTo(Type.VARCHAR);
-                return castExpr;
-            }
-        } else if (dstType != srcType) {
-            CastExpr castExpr = (CastExpr)expr.castTo(slotDesc.getType());
-            return castExpr;
+        if (dstType != srcType) {
 
 Review comment:
   It won't produce CastExpr, when source and target are char or varchar, they are all treated as String in CastFunction. Expr has handled it in member function 'castTo'.  And i have tested cases that table's attribute types contain char or varchar.

----------------------------------------------------------------
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


With regards,
Apache Git Services

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