MCPcopy Create free account
hub / github.com/apache/cloudberry / extractFuncExprArgs

Function extractFuncExprArgs

src/backend/executor/nodeNestloop.c:739–770  ·  view source on GitHub ↗

---------------------------------------------------------------- * extractFuncExprArgs * * Extract the arguments of a FuncExpr or an OpExpr and append them into two * given lists: * - lclauses for the left side of the expression, * - rclauses for the right side * * This function is only used for LASJ. Once we find a NULL from inner side, we * can skip the join and just return an empty

Source from the content-addressed store, hash-verified

737 * ----------------------------------------------------------------
738 */
739static void
740extractFuncExprArgs(Expr *clause, List **lclauses, List **rclauses)
741{
742 if (IsA(clause, OpExpr))
743 {
744 OpExpr *opexpr = (OpExpr *) clause;
745
746 if (list_length(opexpr->args) != 2)
747 return;
748
749 if (!op_strict(opexpr->opno))
750 return;
751
752 *lclauses = lappend(*lclauses, linitial(opexpr->args));
753 *rclauses = lappend(*rclauses, lsecond(opexpr->args));
754 }
755 else if (IsA(clause, FuncExpr))
756 {
757 FuncExpr *fexpr = (FuncExpr *) clause;
758
759 if (list_length(fexpr->args) != 2)
760 return;
761
762 if (!func_strict(fexpr->funcid))
763 return;
764
765 *lclauses = lappend(*lclauses, linitial(fexpr->args));
766 *rclauses = lappend(*rclauses, lsecond(fexpr->args));
767 }
768 else
769 elog(ERROR, "unexpected join qual in JOIN_LASJ_NOTIN join");
770}

Callers 1

splitJoinQualExprFunction · 0.85

Calls 4

list_lengthFunction · 0.85
op_strictFunction · 0.85
lappendFunction · 0.85
func_strictFunction · 0.85

Tested by

no test coverage detected