This is an automated email from the ASF dual-hosted git repository. mblow pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/asterixdb.git
commit 1aab564b7806d0833f81d35b45cef3717becc6fb Author: murali4104 <[email protected]> AuthorDate: Tue Jan 16 20:21:47 2024 -0800 [NO ISSUE][*DB][CBO] Fixing problem with or predicate Avoid ClassCastException when the first argument of an 'OR' is not a function. (cherry picked from commit 335ca4d2) Change-Id: I15b3709de3af9d42349aac81b52e6c48e364d688 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18106 Reviewed-by: Michael Blow <[email protected]> Reviewed-by: Murtadha Hubail <[email protected]> Tested-by: Michael Blow <[email protected]> --- .../src/main/java/org/apache/asterix/optimizer/rules/cbo/Stats.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/Stats.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/Stats.java index b3c4876a4d..38d817b454 100644 --- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/Stats.java +++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/Stats.java @@ -135,9 +135,8 @@ public class Stats { double sel = 1.0; if (afcExpr.getFunctionIdentifier().equals(AlgebricksBuiltinFunctions.OR)) { - double orSel = getSelectivityFromAnnotation( - (AbstractFunctionCallExpression) afcExpr.getArguments().get(0).getValue(), join); - for (int i = 1; i < afcExpr.getArguments().size(); i++) { + double orSel = 0.0; + for (int i = 0; i < afcExpr.getArguments().size(); i++) { ILogicalExpression lexpr = afcExpr.getArguments().get(i).getValue(); if (lexpr.getExpressionTag().equals(LogicalExpressionTag.FUNCTION_CALL)) { sel = getSelectivityFromAnnotation(
