Fix the 4016 error in direct load

This commit is contained in:
obdev
2023-02-27 06:13:21 +00:00
committed by ob-robot
parent 9a243409f1
commit 9c351ef732

View File

@ -8,6 +8,7 @@
#include "storage/tablet/ob_tablet.h"
#include "storage/tx_storage/ob_ls_handle.h"
#include "storage/tx_storage/ob_ls_service.h"
#include "storage/ob_relative_table.h"
namespace oceanbase
{
@ -226,6 +227,7 @@ int ObDirectLoadOriginTableScanner::init_table_access_param()
const uint64_t table_id = origin_table_->get_meta().table_id_;
ObSchemaGetterGuard schema_guard;
const ObTableSchema *table_schema = nullptr;
ObRelativeTable relative_table;
if (OB_FAIL(ObMultiVersionSchemaService::get_instance().get_tenant_schema_guard(tenant_id,
schema_guard))) {
LOG_WARN("fail to get tenant schema guard", KR(ret), K(tenant_id));
@ -236,18 +238,22 @@ int ObDirectLoadOriginTableScanner::init_table_access_param()
LOG_WARN("table not exist", KR(ret), K(tenant_id), K(table_id));
} else if (OB_FAIL(schema_param_.convert(table_schema))) {
LOG_WARN("fail to convert schema para", KR(ret));
} else if (OB_FAIL(table_access_param_.init_merge_param(origin_table_->get_meta().table_id_,
origin_table_->get_meta().tablet_id_,
schema_param_.get_read_info()))) {
LOG_WARN("fail to init merge param", KR(ret));
} else if (OB_FAIL(relative_table.init(&schema_param_, origin_table_->get_meta().tablet_id_))) {
LOG_WARN("fail to init relative table", KR(ret));
}
for (int64_t i = 0; OB_SUCC(ret) && i < schema_param_.get_read_info().get_schema_column_count(); ++i) {
if (OB_FAIL(col_ids_.push_back(i))) {
LOG_WARN("fail to push back col id", KR(ret), K(i));
}
}
if (OB_SUCC(ret)) {
table_access_param_.iter_param_.out_cols_project_ = &col_ids_;
if (OB_FAIL(table_access_param_.init_dml_access_param(relative_table,
origin_table_->get_tablet_handle().get_obj()->get_full_read_info(),
schema_param_,
&col_ids_))) {
LOG_WARN("fail to init merge param", KR(ret));
}
}
return ret;
}