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 2022/04/11 08:30:22 UTC

[GitHub] [incubator-doris] Henry2SS commented on a diff in pull request #8919: [Feature] (sql digest) support sql digest

Henry2SS commented on code in PR #8919:
URL: https://github.com/apache/incubator-doris/pull/8919#discussion_r847072683


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java:
##########
@@ -871,12 +871,20 @@ public String toSql() {
         return (printSqlInParens) ? "(" + toSqlImpl() + ")" : toSqlImpl();
     }
 
+    public String toDigest() {
+        return (printSqlInParens) ? "(" + toDigestImpl() + ")" : toDigestImpl();
+    }
+
     /**
      * Returns a SQL string representing this expr. Subclasses should override this method
      * instead of toSql() to ensure that parenthesis are properly added around the toSql().
      */
     protected abstract String toSqlImpl();
 
+    protected String toDigestImpl() {
+        return toSqlImpl();

Review Comment:
   Thx for your reply.
   The abstract method `toSqlImpl()` will be overrided in each subclass. So there is no need to throw out exceptions.
   The only situation is that a newly added subclass, which its sql digest needs to be different from sql impl, should override this method.
   
   Added comments over this method to remind developers.



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