提交 05d841b9 编写于 作者: J JLY2015 提交者: ob-robot

[CP] [vctor index] fix show create table display index

上级 f25cb149
...@@ -826,7 +826,7 @@ int ObSchemaPrinter::print_table_definition_indexes(const ObTableSchema &table_s ...@@ -826,7 +826,7 @@ int ObSchemaPrinter::print_table_definition_indexes(const ObTableSchema &table_s
// Do not print global index. // Do not print global index.
} else if (index_schema->is_built_in_index()) { } else if (index_schema->is_built_in_index()) {
// For full-text or vector index search index, only inverted table can be printed, and others table will not be printed. // For full-text or vector index search index, only inverted table can be printed, and others table will not be printed.
} else if (index_schema->is_vec_index() && index_schema->get_index_status() != INDEX_STATUS_AVAILABLE) { } else if (index_schema->is_vec_index() && !ObVectorIndexUtil::check_index_is_all_ready(schema_guard_, table_schema, *index_schema)) {
// Not show vec index which in unavaliable status // Not show vec index which in unavaliable status
} else if (OB_FAIL(print_single_index_definition(index_schema, table_schema, arena_allocator, } else if (OB_FAIL(print_single_index_definition(index_schema, table_schema, arena_allocator,
buf, buf_len, pos, is_unique_index, is_oracle_mode, false, sql_mode, tz_info))) { buf, buf_len, pos, is_unique_index, is_oracle_mode, false, sql_mode, tz_info))) {
......
...@@ -4476,6 +4476,29 @@ int ObVectorIndexUtil::get_vector_index_column_name( ...@@ -4476,6 +4476,29 @@ int ObVectorIndexUtil::get_vector_index_column_name(
return ret; return ret;
} }
bool ObVectorIndexUtil::check_index_is_all_ready(
ObSchemaGetterGuard &schema_guard,
const schema::ObTableSchema &table_schema,
const schema::ObTableSchema &index_schema)
{
int ret = OB_SUCCESS;
bool is_all_ready = false;
ObArray<ObString> vec_column_names;
if (index_schema.is_built_in_index()) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpected index type", K(ret), K(index_schema));
} else if (OB_FAIL(get_vector_index_column_name(table_schema, index_schema, vec_column_names))) {
LOG_WARN("fail to get vector index column name", K(ret));
} else if (vec_column_names.count() <= 0) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("unexpected vec column count", K(ret), K(index_schema));
} else if (OB_FAIL(check_vector_index_by_column_name(schema_guard, table_schema, vec_column_names.at(0), is_all_ready))) {
LOG_WARN("fail to check vector index by column name", K(ret), K(vec_column_names));
}
return is_all_ready;
}
bool ObVectorIndexUtil::is_match_index_column_name( bool ObVectorIndexUtil::is_match_index_column_name(
const schema::ObTableSchema &table_schema, const schema::ObTableSchema &table_schema,
const schema::ObTableSchema &index_schema, const schema::ObTableSchema &index_schema,
......
...@@ -748,6 +748,10 @@ public: ...@@ -748,6 +748,10 @@ public:
const uint64_t tenant_id, const uint64_t tenant_id,
const int64_t tablet_row_count, const int64_t tablet_row_count,
int64_t &estimate_memory); int64_t &estimate_memory);
static bool check_index_is_all_ready(
ObSchemaGetterGuard &schema_guard,
const schema::ObTableSchema &table_schema,
const schema::ObTableSchema &index_schema);
static int alter_vec_aux_column_schema(const ObTableSchema &aux_table_schema, static int alter_vec_aux_column_schema(const ObTableSchema &aux_table_schema,
const ObColumnSchemaV2 &new_column_schema, const ObColumnSchemaV2 &new_column_schema,
ObColumnSchemaV2 &new_aux_column_schema); ObColumnSchemaV2 &new_aux_column_schema);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册