@@ -23,7 +23,8 @@ namespace facebook::velox::core {
2323
2424class InputTypedExpr : public ITypedExpr {
2525 public:
26- explicit InputTypedExpr (TypePtr type) : ITypedExpr{std::move (type)} {}
26+ explicit InputTypedExpr (TypePtr type)
27+ : ITypedExpr{ExprKind::kInput , std::move (type)} {}
2728
2829 bool operator ==(const ITypedExpr& other) const final {
2930 const auto * casted = dynamic_cast <const InputTypedExpr*>(&other);
@@ -59,12 +60,13 @@ class ConstantTypedExpr : public ITypedExpr {
5960 // Creates constant expression. For complex types, only
6061 // Variant::null() value is supported.
6162 ConstantTypedExpr (TypePtr type, Variant value)
62- : ITypedExpr{std::move (type)}, value_{std::move (value)} {}
63+ : ITypedExpr{ExprKind::kConstant , std::move (type)},
64+ value_{std::move (value)} {}
6365
6466 // Creates constant expression of scalar or complex type. The value comes from
6567 // index zero.
6668 explicit ConstantTypedExpr (const VectorPtr& value)
67- : ITypedExpr{value->type ()},
69+ : ITypedExpr{ExprKind:: kConstant , value->type ()},
6870 valueVector_{
6971 value->isConstantEncoding ()
7072 ? value
@@ -184,7 +186,7 @@ class CallTypedExpr : public ITypedExpr {
184186 TypePtr type,
185187 std::vector<TypedExprPtr> inputs,
186188 std::string name)
187- : ITypedExpr{std::move (type), std::move (inputs)},
189+ : ITypedExpr{ExprKind:: kCall , std::move (type), std::move (inputs)},
188190 name_ (std::move(name)) {}
189191
190192 virtual const std::string& name () const {
@@ -247,14 +249,14 @@ class FieldAccessTypedExpr : public ITypedExpr {
247249 public:
248250 // / Used as a leaf in an expression tree specifying input column by name.
249251 FieldAccessTypedExpr (TypePtr type, std::string name)
250- : ITypedExpr{std::move (type)},
252+ : ITypedExpr{ExprKind:: kFieldAccess , std::move (type)},
251253 name_ (std::move(name)),
252254 isInputColumn_ (true ) {}
253255
254256 // / Used as a dereference expression which selects a subfield in a struct by
255257 // / name.
256258 FieldAccessTypedExpr (TypePtr type, TypedExprPtr input, std::string name)
257- : ITypedExpr{std::move (type), {std::move (input)}},
259+ : ITypedExpr{ExprKind:: kFieldAccess , std::move (type), {std::move (input)}},
258260 name_ (std::move(name)),
259261 isInputColumn_ (dynamic_cast <const InputTypedExpr*>(inputs()[0 ].get())) {
260262 }
@@ -323,7 +325,8 @@ using FieldAccessTypedExprPtr = std::shared_ptr<const FieldAccessTypedExpr>;
323325class DereferenceTypedExpr : public ITypedExpr {
324326 public:
325327 DereferenceTypedExpr (TypePtr type, TypedExprPtr input, uint32_t index)
326- : ITypedExpr{std::move (type), {std::move (input)}}, index_(index) {
328+ : ITypedExpr{ExprKind::kDereference , std::move (type), {std::move (input)}},
329+ index_ (index) {
327330 // Make sure this isn't being used to access a top level column.
328331 VELOX_USER_CHECK_NULL (
329332 std::dynamic_pointer_cast<const InputTypedExpr>(inputs ()[0 ]));
@@ -445,9 +448,11 @@ using ConcatTypedExprPtr = std::shared_ptr<const ConcatTypedExpr>;
445448class LambdaTypedExpr : public ITypedExpr {
446449 public:
447450 LambdaTypedExpr (RowTypePtr signature, TypedExprPtr body)
448- : ITypedExpr(std::make_shared<FunctionType>(
449- std::vector<TypePtr>(signature->children ()),
450- body->type())),
451+ : ITypedExpr(
452+ ExprKind::kLambda ,
453+ std::make_shared<FunctionType>(
454+ std::vector<TypePtr>(signature->children ()),
455+ body->type())),
451456 signature_(std::move(signature)),
452457 body_(std::move(body)) {}
453458
@@ -512,13 +517,13 @@ class CastTypedExpr : public ITypedExpr {
512517 // / and expected to be different from to-type.
513518 // / @param isTryCast Whether this expression is used for `try_cast`.
514519 CastTypedExpr (const TypePtr& type, const TypedExprPtr& input, bool isTryCast)
515- : ITypedExpr{type, {input}}, isTryCast_(isTryCast) {}
520+ : ITypedExpr{ExprKind:: kCast , type, {input}}, isTryCast_(isTryCast) {}
516521
517522 CastTypedExpr (
518523 const TypePtr& type,
519524 const std::vector<TypedExprPtr>& inputs,
520525 bool isTryCast)
521- : ITypedExpr{type, inputs}, isTryCast_(isTryCast) {
526+ : ITypedExpr{ExprKind:: kCast , type, inputs}, isTryCast_(isTryCast) {
522527 VELOX_USER_CHECK_EQ (
523528 1 , inputs.size (), " Cast expression requires exactly one input" );
524529 }
0 commit comments