use of org.apache.drill.exec.vector.complex.writer.BaseWriter.MapWriter in project drill by apache.
the class HttpdLogRecord method setWildcard.
/**
* This method is referenced and called via reflection. When the parser processes a field like:
* HTTP.URI:request.firstline.uri.query.* where star is an arbitrary field that the parser found this method will be
* invoked. <br>
*
* @param field name of field
* @param value value of field
*/
@SuppressWarnings("unused")
public void setWildcard(final String field, final Double value) {
if (value != null) {
final MapWriter mapWriter = getWildcardWriter(field);
LOG.trace("Parsed wildcard field: {}, as double: {}", field, value);
final Float8Writer w = mapWriter.float8(cleanExtensions.get(field));
w.writeFloat8(value);
}
}
use of org.apache.drill.exec.vector.complex.writer.BaseWriter.MapWriter in project drill by apache.
the class HttpdLogRecord method setWildcard.
/**
* This method is referenced and called via reflection. When the parser processes a field like:
* HTTP.URI:request.firstline.uri.query.* where star is an arbitrary field that the parser found this method will be
* invoked. <br>
*
* @param field name of field
* @param value value of field
*/
@SuppressWarnings("unused")
public void setWildcard(final String field, final String value) {
if (value != null) {
final MapWriter mapWriter = getWildcardWriter(field);
LOG.trace("Parsed wildcard field: {}, as string: {}", field, value);
final VarCharWriter w = mapWriter.varChar(cleanExtensions.get(field));
writeString(w, value);
}
}
use of org.apache.drill.exec.vector.complex.writer.BaseWriter.MapWriter in project drill by apache.
the class TestPromotableWriter method list.
@Test
public void list() throws Exception {
BufferAllocator allocator = RootAllocatorFactory.newRoot(DrillConfig.create());
TestOutputMutator output = new TestOutputMutator(allocator);
ComplexWriter rootWriter = new VectorContainerWriter(output, true);
MapWriter writer = rootWriter.rootAsMap();
rootWriter.setPosition(0);
{
writer.map("map").bigInt("a").writeBigInt(1);
}
rootWriter.setPosition(1);
{
writer.map("map").float4("a").writeFloat4(2.0f);
}
rootWriter.setPosition(2);
{
writer.map("map").list("a").startList();
writer.map("map").list("a").endList();
}
rootWriter.setPosition(3);
{
writer.map("map").list("a").startList();
writer.map("map").list("a").bigInt().writeBigInt(3);
writer.map("map").list("a").float4().writeFloat4(4);
writer.map("map").list("a").endList();
}
rootWriter.setValueCount(4);
BatchPrinter.printBatch(output.getContainer());
}
Aggregations