| 888 | } |
| 889 | |
| 890 | column_index_t exprToChannel( |
| 891 | const core::ITypedExpr* expr, |
| 892 | const TypePtr& type) { |
| 893 | if (auto field = dynamic_cast<const core::FieldAccessTypedExpr*>(expr)) { |
| 894 | return type->as<TypeKind::ROW>().getChildIdx(field->name()); |
| 895 | } |
| 896 | if (dynamic_cast<const core::ConstantTypedExpr*>(expr)) { |
| 897 | return kConstantChannel; |
| 898 | } |
| 899 | BOLT_FAIL( |
| 900 | "Expression must be field access or constant, got: {}", expr->toString()); |
| 901 | return 0; // not reached. |
| 902 | } |
| 903 | |
| 904 | std::vector<column_index_t> calculateOutputChannels( |
| 905 | const RowTypePtr& sourceOutputType, |