Skip to content

Commit

Permalink
First 3 Query tests working.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckerle committed Nov 9, 2023
1 parent 5628c2e commit 96e602e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.apache.drill.exec.vector.accessor.ArrayWriter;
import org.apache.drill.exec.vector.accessor.ColumnWriter;
import org.apache.drill.exec.vector.accessor.TupleWriter;
import org.apache.drill.exec.vector.accessor.writer.MapWriter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scala.Enumeration;
Expand Down Expand Up @@ -132,7 +133,14 @@ public void startComplex(InfosetComplexElement diComplex) {

@Override
public void endComplex(InfosetComplexElement diComplex) {
assert(columnWriter() instanceof TupleWriter);
ColumnWriter cw = columnWriter();
assert(cw instanceof TupleWriter);
if (cw instanceof MapWriter) {
// It's an inner map, not the top-level.
((MapWriter) columnWriter()).endWrite();
} else {
// do nothing. The endRow() happens in the DaffodilBatchReader next() method
}
columnWriterStack.pop();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ public void testComplexQuery1() throws Exception {
rdr.next();
String map = rdr.column(0).getAsString();
assertEquals("{257, 258}", map);
results.clear();
}

@Test
Expand Down Expand Up @@ -162,5 +163,7 @@ public void testComplexArrayQuery1() throws Exception {
map = ar.tuple().getAsString();
assertEquals("{261, 262}", map);
assertFalse(ar.next());

results.clear();
}
}

0 comments on commit 96e602e

Please sign in to comment.