Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/1091#discussion_r162847468
--- Diff:
exec/java-exec/src/test/java/org/apache/drill/exec/physical/unit/TestOutputBatchSize.java
---
@@ -0,0 +1,498 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.drill.exec.physical.unit;
+
+import com.google.common.collect.Lists;
+import org.apache.drill.common.expression.SchemaPath;
+
+import org.apache.drill.exec.physical.base.AbstractBase;
+import org.apache.drill.exec.physical.base.PhysicalOperator;
+import org.apache.drill.exec.physical.config.FlattenPOP;
+import org.apache.drill.exec.physical.impl.ScanBatch;
+import org.apache.drill.exec.physical.impl.spill.RecordBatchSizer;
+import org.apache.drill.exec.record.RecordBatch;
+import org.apache.drill.exec.record.VectorAccessible;
+import org.apache.drill.exec.util.JsonStringArrayList;
+import org.apache.drill.exec.util.JsonStringHashMap;
+import org.apache.drill.exec.util.Text;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class TestOutputBatchSize extends PhysicalOpUnitTestBase {
--- End diff --
It seems the tests expect a small number of output records. I wonder, do we
have a test with a large number of records, that will expand into a larger
number of records, so that we can actually test the batch size limit?
Something like this: generate a large JSON file (at least two batch sizes
worth) of records something like this:
```
(id1, dummy1, [id2, dummy2])
```
id1 and id2 are just increasing numbers. dummy1 and dummy2 are large
strings, created just to take up space. Put, say, 10, 20 or more records in
each array.
Given the sizes, we should be able to predict the number of output records
per output batch. Since the tests here verify that the data is correct, we only
need verify that the batches are the right size.
In DRILL-6049 (PR #1085) there is a class that reads a multi-batch result
set as a series of row sets. With the row set, you can easily get the number of
rows per batch. (Can also be done with the older mechanisms, if with a bit more
code.)
Then, run the test to make sure the batches contain the number of records
predicted by the size calcs.
To reduce the amount of data, you can even use the ClusterFixture mechanism
(or alter system) to reduce the output batch size.
---