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 2020/06/30 05:47:09 UTC

[GitHub] [incubator-doris] wuyunfeng opened a new pull request #3985: [Doris On ES] fix potential null pointer exception and refactor function process logic

wuyunfeng opened a new pull request #3985:
URL: https://github.com/apache/incubator-doris/pull/3985


   


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

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


[GitHub] [incubator-doris] wuyunfeng commented on pull request #3985: [Doris On ES] [Bug-Fix][Refactor] Fix potential null pointer exception and refactor function process logic

Posted by GitBox <gi...@apache.org>.
wuyunfeng commented on pull request #3985:
URL: https://github.com/apache/incubator-doris/pull/3985#issuecomment-651743793


   @blackfox1983 done


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

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


[GitHub] [incubator-doris] blackfox1983 commented on a change in pull request #3985: [Doris On ES] [Bug-Fix][Refactor] Fix potential null pointer exception and refactor function process logic

Posted by GitBox <gi...@apache.org>.
blackfox1983 commented on a change in pull request #3985:
URL: https://github.com/apache/incubator-doris/pull/3985#discussion_r447429719



##########
File path: be/src/exec/es/es_predicate.cpp
##########
@@ -283,93 +283,91 @@ Status EsPredicate::build_disjuncts_list(const Expr* conjunct) {
         _disjuncts.push_back(predicate);
         return Status::OK();
     }
-    
-    if (is_match_func(conjunct)) {
-        Expr* expr = conjunct->get_child(1);
-        ExtLiteral literal(expr->type().type, _context->get_value(expr, NULL));
-        vector<ExtLiteral> query_conditions;
-        query_conditions.emplace_back(literal);
-        vector<ExtColumnDesc> cols; //TODO
-        ExtPredicate* predicate = new ExtFunction(
-                        TExprNodeType::FUNCTION_CALL,
-                        conjunct->fn().name.function_name,
-                        cols,
-                        query_conditions);
-        if (_es_query_status.ok()) {
-            _es_query_status 
-                = BooleanQueryBuilder::check_es_query(*(ExtFunction *)predicate); 
-            if (!_es_query_status.ok()) {
-                delete predicate;
-                return _es_query_status;
-            }
-        }
-        _disjuncts.push_back(predicate);
-
-        return Status::OK();
-    }
-
-    if (TExprNodeType::FUNCTION_CALL == conjunct->node_type()
-        && (conjunct->fn().name.function_name == "is_null_pred" || conjunct->fn().name.function_name == "is_not_null_pred")) {
-        // such as sub-query: select * from (select split_part(k, "_", 1) as new_field from case_replay_for_milimin) t where t.new_field > 1;
-        // conjunct->get_child(0)->node_type() == TExprNodeType::FUNCTION_CALL, at present doris on es can not support push down function 
-        RETURN_ERROR_IF_EXPR_IS_NOT_SLOTREF(conjunct->get_child(0));
-        SlotRef* slot_ref = (SlotRef*)(conjunct->get_child(0));
-        const SlotDescriptor* slot_desc = get_slot_desc(slot_ref);
-        bool is_not_null;
-        if (conjunct->fn().name.function_name == "is_null_pred") {
-            is_not_null = false;
-        } else {
-            is_not_null = true;
-        }
-        std::string col = slot_desc->col_name();
-        if (_field_context.find(col) != _field_context.end()) {
-            col = _field_context[col];
-        }
-        // use TExprNodeType::IS_NULL_PRED for BooleanQueryBuilder translate
-        ExtIsNullPredicate* predicate = new ExtIsNullPredicate(TExprNodeType::IS_NULL_PRED, col, slot_desc->type(), is_not_null);
-        _disjuncts.push_back(predicate);
-        return Status::OK();
-    }
-
+    // process function call predicate: esquery, is_null_pred, is_not_null_pred
     if (TExprNodeType::FUNCTION_CALL == conjunct->node_type()) {
         std::string fname = conjunct->fn().name.function_name;
-        if (fname != "like") {
-            return Status::InternalError("build disjuncts failed: function name is not like");
-        }
+        if (fname == "esquery") {
+            Expr* expr = conjunct->get_child(1);

Review comment:
       判断下 conjunt->children_size()?
   我看后面很多直接取index的。




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

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


[GitHub] [incubator-doris] morningman merged pull request #3985: [Doris On ES] [Bug-Fix][Refactor] Fix potential null pointer exception and refactor function process logic

Posted by GitBox <gi...@apache.org>.
morningman merged pull request #3985:
URL: https://github.com/apache/incubator-doris/pull/3985


   


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

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