morningman commented on a change in pull request #6051:
URL: https://github.com/apache/incubator-doris/pull/6051#discussion_r659909692



##########
File path: be/src/runtime/decimalv2_value.cpp
##########
@@ -192,7 +192,7 @@ DecimalV2Value operator/(const DecimalV2Value& v1, const 
DecimalV2Value& v2) {
     int128_t x = v1.value();
     int128_t y = v2.value();
 
-    //todo: return 0 for divide zero
+    DCHECK(y != 0);
     if (x == 0 || y == 0) return DecimalV2Value(0);

Review comment:
       ```suggestion
       if (x == 0) return DecimalV2Value(0);
   ```

##########
File path: be/src/runtime/decimalv2_value.cpp
##########
@@ -207,7 +207,7 @@ DecimalV2Value operator%(const DecimalV2Value& v1, const 
DecimalV2Value& v2) {
     int128_t x = v1.value();
     int128_t y = v2.value();
 
-    //todo: return 0 for divide zero
+    DCHECK(y != 0);
     if (x == 0 || y == 0) return DecimalV2Value(0);

Review comment:
       ```suggestion
       if (x == 0) return DecimalV2Value(0);
   ```




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

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to