47 const auto scan_ra =
dynamic_cast<const RelScan*
>(source_ra);
49 const auto join_ra =
dynamic_cast<const RelJoin*
>(source_ra);
53 return visitInput(&node_inputs[input->
getIndex()]);
57 const auto scan_td = scan_ra->getTableDescriptor();
59 const int col_id = input->
getIndex() + 1;
60 const int table_id = scan_td->tableId;
62 auto db_id = scan_ra->getCatalog().getDatabaseId();
63 return {{col_id, table_id, db_id}};
67 const auto ra = subquery->getRelAlg();
70 return visitor.
visit(ra);
75 if (
auto window_oper = dynamic_cast<const RexWindowFunctionOperator*>(oper)) {
76 for (
const auto& partition_key : window_oper->getPartitionKeys()) {
77 if (
auto input = dynamic_cast<const RexInput*>(partition_key.get())) {
78 const auto source_node = input->getSourceNode();
79 if (
auto filter_node = dynamic_cast<const RelFilter*>(source_node)) {
84 CHECK_EQ(filter_node->inputCount(), size_t(1));
85 const auto parent_node = filter_node->getInput(0);
87 CHECK_LT(input->getIndex(), node_inputs.size());
88 result = aggregateResult(result, visitInput(&node_inputs[input->getIndex()]));
90 result = aggregateResult(result, visit(input));
94 for (
size_t i = 0; i < oper->
size(); i++) {
95 result = aggregateResult(result, visit(oper->
getOperand(i)));
104 result.insert(next_result.begin(), next_result.end());
116 const auto rex_phys_inputs = visitor.visit(rex);
117 result.insert(rex_phys_inputs.begin(), rex_phys_inputs.end());
122 const auto filter_phys_inputs = visitor.visit(filter);
123 result.insert(filter_phys_inputs.begin(), filter_phys_inputs.end());
132 return visitor.visit(condition);
141 return visitor.visit(condition);
150 result = visitor.visit(condition);
153 for (
size_t nesting_level = 1; nesting_level <= left_deep_inner_join->
inputCount() - 1;
155 const auto outer_condition = left_deep_inner_join->
getOuterCondition(nesting_level);
156 if (outer_condition) {
157 const auto outer_result = visitor.visit(outer_condition);
158 result.insert(outer_result.begin(), outer_result.end());
167 for (
size_t i = 0; i < project->
size(); ++i) {
171 const auto rex_phys_inputs = visitor.visit(rex);
172 result.insert(rex_phys_inputs.begin(), rex_phys_inputs.end());
186 result.insert(next_result.begin(), next_result.end());
217 RelAlgPhysicalInputsVisitor phys_inputs_visitor;
218 return phys_inputs_visitor.visit(ra);
222 return RelAlgPhysicalTableInputsVisitor::getTableIds(ra);
226 return os <<
'(' << physical_input.
col_id <<
',' << physical_input.
table_id <<
','
227 << physical_input.
db_id <<
')';
virtual void visit(RelAlgNode const *)
size_t size() const override
const RexScalar * getFilterExpr() const
const Catalog_Namespace::Catalog & getCatalog() const
const RexScalar * getOuterCondition(const size_t nesting_level) const
std::ostream & operator<<(std::ostream &os, const SessionInfo &session_info)
const RexScalar * getOperand(const size_t idx) const
const RexScalar * getCondition() const
DEVICE void sort(ARGS &&...args)
const RexScalar * getCondition() const
const size_t getScalarSourcesSize() const
T visit(const RelAlgNode *rel_alg) const
const RelAlgNode * getInput(const size_t idx) const
int getDatabaseId() const
const RexScalar * getProjectAt(const size_t idx) const
std::size_t hash_value(RexAbstractInput const &rex_ab_input)
const RexScalar * getInnerCondition() const
size_t compute_hash(int32_t item_1, int32_t item_2)
const size_t inputCount() const
const TableDescriptor * getTableDescriptor() const
RANodeOutput get_node_output(const RelAlgNode *ra_node)
const RexScalar * getScalarSource(const size_t i) const