You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Alice Chen (JIRA)" <ji...@apache.org> on 2015/07/22 20:20:08 UTC
[jira] [Created] (TRAFODION-1129) LP Bug: 1439785 - TMUDF: Add an
interface that makes it easier to detect partition boundaries
Alice Chen created TRAFODION-1129:
-------------------------------------
Summary: LP Bug: 1439785 - TMUDF: Add an interface that makes it easier to detect partition boundaries
Key: TRAFODION-1129
URL: https://issues.apache.org/jira/browse/TRAFODION-1129
Project: Apache Trafodion
Issue Type: Bug
Components: sql-cmp
Reporter: Hans Zeller
Assignee: Hans Zeller
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
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)