oss_src/sframe_query_engine/operators/operator_properties.cpp
static length_info propagate_length(
    const pnode_ptr& n, std::map<pnode_ptr, length_info>& visited) {
  auto it = visited.find(n);
  if(it != visited.end()) return it->second;

  auto inferred_length = infer_planner_node_length(n);
  if (inferred_length >= 0) {
    length_info li{inferred_length, nullptr};
    visited[n] = li;
    return li;
  }

  if(is_linear_transform(n)) {
    ASSERT_FALSE(n->inputs.empty());
    auto li = propagate_length(n->inputs.front(), visited);
    visited[n] = li;
    return li;
  } else {
    return length_info{-1, n.get()};
  }
}
/*
 * This function returns for a given node, a "length_info" attribute.
 *  - length_info.source_length: The length of the node if known. -1 if not known
 *  - source_node: If the length is unkonwn, this contains a unique descriptor
 *                 of the length. i.e. if two differet nodes have the same
 *                 descriptor, they have the same length. But if they have
 *                 different descriptors, there is nothing we can say about
 *                 their lengths.
 */
This function returns for a given node, a "length_info" attribute.
- length_info.source_length: The length of the node if known. -1 if not known
- source_node: If the length is unkonwn, this contains a unique descriptor
of the length.
This function returns for a given node a " length_info " attribute . - length_info . source_length : The length of the node if known . - 1 if not known - source_node : If the length is unkonwn this contains a unique descriptor of the length .
static length_info propagate_length(
    const pnode_ptr& n, std::map<pnode_ptr, length_info>& visited) {
  auto it = visited.find(n);
  if(it != visited.end()) return it->second;
  auto inferred_length = infer_planner_node_length(n);
  if (inferred_length >= 0) {
    length_info li{inferred_length, nullptr};
    visited[n] = li;
    return li;
  }
  if(is_linear_transform(n)) {
    ASSERT_FALSE(n->inputs.empty());
    auto li = propagate_length(n->inputs.front(), visited);
    visited[n] = li;
    return li;
  } else {
    return length_info{-1, n.get()};
  }
}
static length_info propagate_length ( const pnode_ptr & n , std :: map < pnode_ptr , length_info > & visited ) { auto it = visited . find ( n ) ; if ( it != visited . end ( ) ) return it -> second ; auto inferred_length = infer_planner_node_length ( n ) ; if ( inferred_length >= 0 ) { length_info li { inferred_length , nullptr } ; visited [ n ] = li ; return li ; } if ( is_linear_transform ( n ) ) { ASSERT_FALSE ( n -> inputs . empty ( ) ) ; auto li = propagate_length ( n -> inputs . front ( ) , visited ) ; visited [ n ] = li ; return li ; } else { return length_info { -1 , n . get ( ) } ; } }
This function returns for a given node, a "length_info" attribute.
This function returns for a given node a " length_info " attribute .