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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to