[FEAT MERGE] add direct load function
Co-authored-by: Monk-Liu <1152761042@qq.com> Co-authored-by: saltonz <saltonzh@gmail.com> Co-authored-by: yongshige <598633031@qq.com>
This commit is contained in:
@ -27,6 +27,51 @@ const int64_t ObDataInFileStruct::DEFAULT_FIELD_ESCAPED_CHAR = static_cast<int64
|
||||
const int64_t ObDataInFileStruct::DEFAULT_FIELD_ENCLOSED_CHAR = INT64_MAX;
|
||||
const bool ObDataInFileStruct::DEFAULT_OPTIONAL_ENCLOSED = false;
|
||||
|
||||
void ObLoadFileIterator::reset()
|
||||
{
|
||||
files_.reset();
|
||||
pos_ = 0;
|
||||
}
|
||||
|
||||
int ObLoadFileIterator::add_files(ObString *start, const int64_t count)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_ISNULL(start) || OB_UNLIKELY(count <= 0)) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("invalid args", KR(ret), KP(start), K(count));
|
||||
} else {
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < count; ++i) {
|
||||
if (OB_FAIL(files_.push_back(start[i]))) {
|
||||
LOG_WARN("fail to push back", KR(ret));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLoadFileIterator::get_next_file(ObString &file)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (pos_ >= files_.count()) {
|
||||
ret = OB_ITER_END;
|
||||
} else {
|
||||
file = files_.at(pos_++);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLoadFileIterator::copy(const ObLoadFileIterator &other)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
if (!other.is_valid()) {
|
||||
ret = OB_INVALID_ARGUMENT;
|
||||
LOG_WARN("get invalid argument", K(ret), K(other));
|
||||
} else if (OB_FAIL(files_.assign(other.files_))) {
|
||||
LOG_WARN("fail to copy array", K(ret));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObLoadDataStmt::add_column_item(ColumnItem &item) {
|
||||
int ret = OB_SUCCESS;
|
||||
if (OB_FAIL(column_items_.push_back(item))) {
|
||||
|
||||
Reference in New Issue
Block a user