IMPALA-3996: Migrate to updated Kudu insert string API In Kudu 0.10 the Insert API changed for Strings and Binary values to avoid ambiguity around memory copying. They changed SetString() to copy the value given to it to avoid misuse, and added a SetStringNoCopy() with the old behavior.
We upgraded to 0.10 which has some perf impact but is still correct. This changes the code to use the NoCopy call which was the behavior we had previously. See Kudu commit: https://github.com/apache/kudu/commit/48766a4ce17d422ced9a6ec78c9a9969ac44d8c9 Change-Id: I910c24724d0bc887b2d4a3e62ecdf72420a76f6f Reviewed-on: http://gerrit.cloudera.org:8080/4055 Reviewed-by: Matthew Jacobs <[email protected]> Tested-by: Internal Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/6b5f9cf0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/6b5f9cf0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/6b5f9cf0 Branch: refs/heads/master Commit: 6b5f9cf0f53d8a9b35182af81ffecb1351e8d477 Parents: 1fc487c Author: Matthew Jacobs <[email protected]> Authored: Thu Aug 18 18:03:30 2016 -0700 Committer: Internal Jenkins <[email protected]> Committed: Sun Aug 21 02:48:52 2016 +0000 ---------------------------------------------------------------------- be/src/exec/kudu-table-sink.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/6b5f9cf0/be/src/exec/kudu-table-sink.cc ---------------------------------------------------------------------- diff --git a/be/src/exec/kudu-table-sink.cc b/be/src/exec/kudu-table-sink.cc index 79a6a83..661489f 100644 --- a/be/src/exec/kudu-table-sink.cc +++ b/be/src/exec/kudu-table-sink.cc @@ -173,7 +173,7 @@ Status KuduTableSink::Send(RuntimeState* state, RowBatch* batch) { case TYPE_STRING: { StringValue* sv = reinterpret_cast<StringValue*>(value); kudu::Slice slice(reinterpret_cast<uint8_t*>(sv->ptr), sv->len); - KUDU_RETURN_IF_ERROR(write->mutable_row()->SetString(col, slice), + KUDU_RETURN_IF_ERROR(write->mutable_row()->SetStringNoCopy(col, slice), "Could not add Kudu WriteOp."); break; }
