Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Impala 2.7.0
    • Fix Version/s: Impala 2.8.0
    • Component/s: Backend
    • Labels:

      Description

      The IR generated for the TopN node is pretty suboptimal. We codegen the outer Insert loop, and we codegen the comparator function, but we don't convert the indirect call to a function pointer comparator into a direct inlinable function call. The below C++ code is just cross-compile wholesale without removing the branch or function pointer, and also bringing in a huge amount of unnecessary IR for the interpreted Compare() path.

        bool ALWAYS_INLINE Less(const TupleRow* lhs, const TupleRow* rhs) const {
          int result = codegend_compare_fn_ == NULL ? Compare(lhs, rhs) :
              (*codegend_compare_fn_)(&key_expr_ctxs_lhs_[0], &key_expr_ctxs_rhs_[0], lhs, rhs);
          if (result < 0) return true;
          return false;
        }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tarmstrong Tim Armstrong
                Reporter:
                tarmstrong Tim Armstrong
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: