diff --git a/hybridse/src/vm/core_api.cc b/hybridse/src/vm/core_api.cc index 62edd8b73b0..d425d9a7b31 100644 --- a/hybridse/src/vm/core_api.cc +++ b/hybridse/src/vm/core_api.cc @@ -211,8 +211,8 @@ hybridse::codec::Row CoreAPI::RowConstProject(const RawPtrHandle fn, } hybridse::codec::Row CoreAPI::RowProject(const RawPtrHandle fn, - const hybridse::codec::Row row, - const hybridse::codec::Row parameter, + const hybridse::codec::Row& row, + const hybridse::codec::Row& parameter, const bool need_free) { if (row.empty()) { return hybridse::codec::Row(); @@ -246,7 +246,7 @@ hybridse::codec::Row CoreAPI::UnsafeRowProject( hybridse::vm::ByteArrayPtr inputUnsafeRowBytes, const int inputRowSizeInBytes, const bool need_free) { // Create Row from input UnsafeRow bytes - auto inputRow = Row(base::RefCountedSlice::Create(inputUnsafeRowBytes, + auto inputRow = Row(base::RefCountedSlice::CreateManaged(inputUnsafeRowBytes, inputRowSizeInBytes)); auto row_ptr = reinterpret_cast(&inputRow); @@ -280,7 +280,7 @@ void CoreAPI::CopyRowToUnsafeRowBytes(const hybridse::codec::Row inputRow, hybridse::codec::Row CoreAPI::WindowProject(const RawPtrHandle fn, const uint64_t row_key, - const Row row, + const Row& row, WindowInterface* window) { if (row.empty()) { return row; @@ -313,7 +313,7 @@ hybridse::codec::Row CoreAPI::WindowProject(const RawPtrHandle fn, } hybridse::codec::Row CoreAPI::WindowProject(const RawPtrHandle fn, - const uint64_t key, const Row row, + const uint64_t key, const Row& row, const bool is_instance, size_t append_slices, WindowInterface* window) { @@ -326,9 +326,9 @@ hybridse::codec::Row CoreAPI::UnsafeWindowProject( hybridse::vm::ByteArrayPtr inputUnsafeRowBytes, const int inputRowSizeInBytes, const bool is_instance, size_t append_slices, WindowInterface* window) { - // tobe + // Create Row from input UnsafeRow bytes - auto row = Row(base::RefCountedSlice::Create(inputUnsafeRowBytes, + auto row = Row(base::RefCountedSlice::CreateManaged(inputUnsafeRowBytes, inputRowSizeInBytes)); return Runner::WindowProject(fn, key, row, Row(), is_instance, append_slices, window->GetWindow()); diff --git a/hybridse/src/vm/core_api.h b/hybridse/src/vm/core_api.h index 4b89eb18a92..ec3cec57d4b 100644 --- a/hybridse/src/vm/core_api.h +++ b/hybridse/src/vm/core_api.h @@ -126,8 +126,8 @@ class CoreAPI { static size_t GetUniqueID(const hybridse::vm::PhysicalOpNode* node); static hybridse::codec::Row RowProject(const hybridse::vm::RawPtrHandle fn, - const hybridse::codec::Row row, - const hybridse::codec::Row parameter, + const hybridse::codec::Row& row, + const hybridse::codec::Row& parameter, const bool need_free = false); static hybridse::codec::Row RowConstProject( const hybridse::vm::RawPtrHandle fn, const hybridse::codec::Row parameter, @@ -144,7 +144,7 @@ class CoreAPI { const int length); static hybridse::codec::Row WindowProject( - const hybridse::vm::RawPtrHandle fn, const uint64_t key, const Row row, + const hybridse::vm::RawPtrHandle fn, const uint64_t key, const Row& row, const bool is_instance, size_t append_slices, WindowInterface* window); // Window project API with Spark UnsafeRow optimization @@ -155,7 +155,7 @@ class CoreAPI { size_t append_slices, WindowInterface* window); static hybridse::codec::Row WindowProject( - const hybridse::vm::RawPtrHandle fn, const uint64_t key, const Row row, + const hybridse::vm::RawPtrHandle fn, const uint64_t key, const Row& row, WindowInterface* window); static hybridse::codec::Row GroupbyProject(