MCPcopy Create free account
hub / github.com/apache/arrow / IsScalarExpression

Method IsScalarExpression

cpp/src/arrow/compute/expression.cc:295–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295bool Expression::IsScalarExpression() const {
296 if (auto lit = literal()) {
297 return lit->is_scalar();
298 }
299
300 if (field_ref()) return true;
301
302 auto call = CallNotNull(*this);
303
304 for (const Expression& arg : call->arguments) {
305 if (!arg.IsScalarExpression()) return false;
306 }
307
308 if (call->function) {
309 return call->function->kind() == compute::Function::SCALAR;
310 }
311
312 // this expression is not bound; make a best guess based on
313 // the default function registry
314 if (auto function = compute::GetFunctionRegistry()
315 ->GetFunction(call->function_name)
316 .ValueOr(nullptr)) {
317 return function->kind() == compute::Function::SCALAR;
318 }
319
320 // unknown function or other error; conservatively return false
321 return false;
322}
323
324bool Expression::IsNullLiteral() const {
325 if (auto lit = literal()) {

Callers 2

ExecuteScalarExpressionFunction · 0.80
TESTFunction · 0.80

Calls 8

field_refFunction · 0.85
CallNotNullFunction · 0.85
GetFunctionRegistryFunction · 0.85
is_scalarMethod · 0.80
ValueOrMethod · 0.80
literalFunction · 0.70
kindMethod · 0.45
GetFunctionMethod · 0.45

Tested by 1

TESTFunction · 0.64