Repository: drill Updated Branches: refs/heads/master 7a151d691 -> a639c51c7
DRILL-3786: Query with window function fails with IllegalFormatConversionException this closes #239 Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/a639c51c Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/a639c51c Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/a639c51c Branch: refs/heads/master Commit: a639c51c7b893e16bd714ef659395a4207a4c5be Parents: 7a151d6 Author: adeneche <[email protected]> Authored: Mon Sep 21 14:32:25 2015 -0700 Committer: adeneche <[email protected]> Committed: Fri Nov 13 11:48:11 2015 -0800 ---------------------------------------------------------------------- .../drill/exec/physical/impl/sort/SortRecordBatchBuilder.java | 2 +- .../apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/a639c51c/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortRecordBatchBuilder.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortRecordBatchBuilder.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortRecordBatchBuilder.java index edbb62f..97a15c4 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortRecordBatchBuilder.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/sort/SortRecordBatchBuilder.java @@ -103,7 +103,7 @@ public class SortRecordBatchBuilder implements AutoCloseable { } if(runningBatches >= Character.MAX_VALUE) { - final String errMsg = String.format("Tried to add more than %d number of batches.", Character.MAX_VALUE); + final String errMsg = String.format("Tried to add more than %d number of batches.", (int) Character.MAX_VALUE); logger.error(errMsg); throw new DrillRuntimeException(errMsg); } http://git-wip-us.apache.org/repos/asf/drill/blob/a639c51c/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java index 0e5b436..51aab67 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java @@ -264,6 +264,7 @@ public class ExternalSortBatch extends AbstractRecordBatch<ExternalSort> { } int totalCount = 0; + int totalBatches = 0; // total number of batches received so far try{ container.clear(); @@ -325,6 +326,7 @@ public class ExternalSortBatch extends AbstractRecordBatch<ExternalSort> { } int count = sv2.getCount(); totalCount += count; + totalBatches++; sorter.setup(context, sv2, incoming); sorter.sort(sv2); RecordBatchData rbd = new RecordBatchData(incoming); @@ -339,6 +341,8 @@ public class ExternalSortBatch extends AbstractRecordBatch<ExternalSort> { (spillCount > 0 && totalSizeInMemory > .75 * highWaterMark) || // If we haven't spilled so far, do we have enough memory for MSorter if this turns out to be the last incoming batch? (spillCount == 0 && !hasMemoryForInMemorySort(totalCount)) || + // If we haven't spilled so far, make sure we don't exceed the maximum number of batches SV4 can address + (spillCount == 0 && totalBatches > Character.MAX_VALUE) || // current memory used is more than 95% of memory usage limit of this operator (totalSizeInMemory > .95 * popConfig.getMaxAllocation()) || // current memory used is more than 95% of memory usage limit of this fragment
