Skip to content
Snippets Groups Projects
Unverified Commit 7f0d6718 authored by Uladzimir Havenchyk's avatar Uladzimir Havenchyk Committed by GitHub
Browse files

QB: reduce number of MLv2 calls (#39208)

parent a5bb1b42
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ export function useJoinCondition(
);
const [operator, _setOperator] = useState<
Lib.JoinConditionOperator | undefined
>(getInitialConditionOperator(query, stageIndex, condition));
>(getInitialConditionOperator(query, stageIndex, conditionParts));
useEffect(() => {
if (condition && previousCondition !== condition) {
......@@ -180,19 +180,16 @@ function getDefaultJoinOperator(
function getInitialConditionOperator(
query: Lib.Query,
stageIndex: number,
condition?: Lib.JoinCondition,
conditionParts: Lib.JoinConditionParts | undefined,
) {
if (condition) {
const { operator, lhsColumn, rhsColumn } = Lib.joinConditionParts(
query,
stageIndex,
condition,
);
if (conditionParts) {
const { operator, lhsColumn, rhsColumn } = conditionParts;
return (
operator ||
getDefaultJoinOperator(query, stageIndex, lhsColumn, rhsColumn)
);
} else {
return getDefaultJoinOperator(query, stageIndex, undefined, undefined);
}
return getDefaultJoinOperator(query, stageIndex, undefined, undefined);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment