aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/providers/common/codec/arrow/yql_codec_buf_output_stream.cpp
blob: e114b052fbfd228fe5ca460ab0e8398d1b227c89 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "yql_codec_buf_output_stream.h"

#include <yql/essentials/public/udf/arrow/defs.h>

#include <arrow/buffer.h>
#include <arrow/buffer.h>

namespace NYql {
namespace NCommon {

arrow::Status TOutputBufArrowOutputStream::Write(const void* data, int64_t nbytes) {
    Buffer_.WriteMany(static_cast<const char*>(data), nbytes);
    BytesWritten_ += nbytes;
    return arrow::Status::OK();
}

arrow::Status TOutputBufArrowOutputStream::Flush() {
    Buffer_.Flush();
    return arrow::Status::OK();
}

} // NCommon
} // NYql