fix recover external table bug
This commit is contained in:
@ -23,6 +23,7 @@
|
||||
#include "sql/ob_sql_utils.h"
|
||||
#include "sql/rewrite/ob_query_range.h"
|
||||
#include "share/backup/ob_backup_io_adapter.h"
|
||||
#include "deps/oblib/src/lib/net/ob_addr.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
@ -420,5 +421,25 @@ int ObExternalTableUtils::calc_assigned_files_to_sqcs(
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObExternalTableUtils::filter_files_in_locations(common::ObIArray<share::ObExternalFileInfo> &files,
|
||||
common::ObIArray<common::ObAddr> &locations,
|
||||
common::ObIArray<share::ObExternalFileInfo> &res)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < files.count(); i++) {
|
||||
ObExternalFileInfo &table_info = files.at(i);
|
||||
bool found = false;
|
||||
for (int64_t j = 0; OB_SUCC(ret) && !found && j < locations.count(); j++) {
|
||||
if (table_info.file_addr_ == locations.at(j)) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (OB_SUCC(ret) && found) {
|
||||
ret = res.push_back(table_info);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace share
|
||||
} // namespace oceanbase
|
||||
|
||||
@ -24,6 +24,7 @@ namespace common
|
||||
{
|
||||
class ObObj;
|
||||
class ObNewRange;
|
||||
class ObAddr;
|
||||
}
|
||||
|
||||
namespace sql
|
||||
@ -98,6 +99,10 @@ class ObExternalTableUtils {
|
||||
const common::ObIArray<ObExternalFileInfo> &files,
|
||||
common::ObIArray<int64_t> &assigned_idx,
|
||||
int64_t sqc_count);
|
||||
|
||||
static int filter_files_in_locations(common::ObIArray<share::ObExternalFileInfo> &files,
|
||||
common::ObIArray<common::ObAddr> &locations,
|
||||
common::ObIArray<share::ObExternalFileInfo> &res);
|
||||
private:
|
||||
static bool is_left_edge(const common::ObObj &value);
|
||||
static bool is_right_edge(const common::ObObj &value);
|
||||
@ -109,6 +114,7 @@ class ObExternalTableUtils {
|
||||
const int64_t last_lineno,
|
||||
common::ObIAllocator &allocator,
|
||||
common::ObNewRange &new_range);
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user