Andrew created DRILL-3935:
-----------------------------
Summary: Modify VarCharWriter to allow passing byte[]
Key: DRILL-3935
URL: https://issues.apache.org/jira/browse/DRILL-3935
Project: Apache Drill
Issue Type: Bug
Components: Execution - Data Types
Reporter: Andrew
Assignee: Andrew
Priority: Minor
Fix For: 1.3.0
In RecordReader implementations, one sometimes has variable-length string data
in the form of byte arrays. It is a cumbersome idiom to pack these into a
DrillBuf, only to pass it on to the write.
I propose adding this method to the VarCharWriter interface: public void
writeVarChar(int start, int end, byte[] bytes);
Without this I currently have to do:
byte[] bytes = value.getBytes(Charsets.UTF_8);
buffer.reallocIfNeeded(bytes.length);
buffer.setBytes(0, bytes);
writer.varChar().writeVarChar(0, bytes.length, buffer);
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)