/** * Call this method after a record has been parsed. This finished the lifecycle of any maps that were written and * removes all the entries for the next record to be able to work. */ public void finishRecord() { for (MapWriter writer : wildcardWriters.values()) { writer.end(); } wildcardWriters.clear(); startedWildcards.clear(); }
writeString(listWriter.map().varChar("Key"), ((KeyValuePair) v).getKey()); writeString(listWriter.map().varChar("Value"), ((KeyValuePair) v).getValue().toString()); listWriter.map().end(); } else { writeString(listWriter.varChar(), v.toString());
mapWriter.end();
@Override public void eval() { if (in.isSet == 0) { // Return empty map org.apache.drill.exec.vector.complex.writer.BaseWriter.MapWriter mapWriter = writer.rootAsMap(); mapWriter.start(); mapWriter.end(); return; } try { jsonReader.setSource(in.start, in.end, in.buffer); jsonReader.write(writer); buffer = jsonReader.getWorkBuf(); } catch (Exception e) { throw new org.apache.drill.common.exceptions.DrillRuntimeException("Error while converting from JSON. ", e); } } }
@Override public void eval() { if (in.isSet == 0) { // Return empty map org.apache.drill.exec.vector.complex.writer.BaseWriter.MapWriter mapWriter = writer.rootAsMap(); mapWriter.start(); mapWriter.end(); return; } try { jsonReader.setSource(in.start, in.end, in.buffer); jsonReader.write(writer); buffer = jsonReader.getWorkBuf(); } catch (Exception e) { throw new org.apache.drill.common.exceptions.DrillRuntimeException("Error while converting from JSON. ", e); } } }
@Override public void end() { getMapWriter().end(); }
@Override public void end() { mapWriter.end(); }
public void end() { if (map != null) { map.end(); } else { list.endList(); } }
@Override public void end() { getMapWriter().end(); }
public void end() { if (map != null) { map.end(); } else { list.endList(); } }