TMUDF: Add an interface that makes it easier to detect partition boundaries

Bug #1439785 reported by Hans Zeller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Trafodion
New
Medium
Hans Zeller

Bug Description

Right now, a TMUDF needs to implement its own code to detect when one partition (defined by the PARTITION BY clause of a table-valued input) ends and the next one begins. Another problem is that it knows that only after it has read the first row of the next partition or encountered EOD. That makes it hard to use passthrough columns in a reducer, because those passthrough columns are not longer available when we detect the end of the partition.

Ideally, we should add two new methods UDF::getNextPartition() and UDF::getNextRowInPartition() as an alternative to UDF::getNextRow(). These methods should read only rows within the partition and keep the passthrough columns available when we reach the end of the partition. A TMUDF utilizing partitions could then look like this:

while (getNextPartition(info))
  {
    while (getNextRowInPartition(info))
      {
        // process the row, could emit rows or accumulate information
      } // loop over rows in partition

    // finalize information

    // copy passthru columns, those are still available in this model
    info.copyPassThruData();
    // emit final row for this partition
    emitRow();
  } // loop over partitions

Tags: sql-cmp
Changed in trafodion:
importance: Wishlist → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.