MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / isEqualImpl

Method isEqualImpl

src/Analyzer/FunctionNode.cpp:169–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169bool FunctionNode::isEqualImpl(const IQueryTreeNode & rhs, CompareOptions /*compare_options*/) const
170{
171 const auto & rhs_typed = assert_cast<const FunctionNode &>(rhs);
172 if (function_name != rhs_typed.function_name || isAggregateFunction() != rhs_typed.isAggregateFunction()
173 || isOrdinaryFunction() != rhs_typed.isOrdinaryFunction() || isWindowFunction() != rhs_typed.isWindowFunction()
174 || nulls_action != rhs_typed.nulls_action)
175 return false;
176
177 /// is_operator is ignored here because it affects only AST formatting
178
179 if (isResolved() != rhs_typed.isResolved())
180 return false;
181 if (!isResolved())
182 return true;
183
184 auto lhs_result_type = getResultType();
185 auto rhs_result_type = rhs.getResultType();
186
187 if (lhs_result_type && rhs_result_type && !lhs_result_type->equals(*rhs_result_type))
188 return false;
189 if (lhs_result_type && !rhs_result_type)
190 return false;
191 if (!lhs_result_type && rhs_result_type)
192 return false;
193
194 return true;
195}
196
197void FunctionNode::updateTreeHashImpl(HashState & hash_state, CompareOptions /*compare_options*/) const
198{

Callers

nothing calls this directly

Calls 7

getResultTypeFunction · 0.85
isOrdinaryFunctionMethod · 0.80
isAggregateFunctionMethod · 0.45
isWindowFunctionMethod · 0.45
isResolvedMethod · 0.45
getResultTypeMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected