Github user adeneche commented on a diff in the pull request:
https://github.com/apache/drill/pull/340#discussion_r53347747
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/window/FrameSupportTemplate.java
---
@@ -134,44 +142,67 @@ private void cleanPartition() {
* @throws DrillException if it can't write into the container
*/
private int processPartition(final int currentRow) throws DrillException
{
- logger.trace("process partition {}, currentRow: {}, outputCount: {}",
partition, currentRow, outputCount);
+ logger.trace("{} rows remaining to process, currentRow: {},
outputCount: {}", remainingRows, currentRow, outputCount);
setupWriteFirstValue(internal, container);
- int row = currentRow;
+ if (popConfig.isRows()) {
+ return processROWS(currentRow);
+ } else {
+ return processRANGE(currentRow);
+ }
+ }
+
+ private int processROWS(int row) throws DrillException {
+ //TODO we only need to call these once per batch
--- End diff --
We do the setup at the beginning of every partition. In case we have
multiple partitions in the same batch setup should only be done once. To make
the matters more complicated, if we are aggregating a single partition that
spans multiple batches, we also need to do the setup for every batch.
The TODO is still valid. I create
[DRILL-4413](https://issues.apache.org/jira/browse/DRILL-4413) to keep track of
it
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---