[vector index] relative variable place holder

This commit is contained in:
JLY2015 2024-06-17 13:40:40 +00:00 committed by ob-robot
parent c93978f05e
commit 020eae1d2b
7 changed files with 70 additions and 5 deletions

View File

@ -66,6 +66,7 @@ enum ObDDLType
DDL_DROP_LOB = 11,
DDL_DROP_FTS_INDEX = 12,
DDL_DROP_MULVALUE_INDEX = 13,
DDL_DROP_VEC_INDEX = 14,
///< @note tablet split.
DDL_AUTO_SPLIT_BY_RANGE = 100,
DDL_AUTO_SPLIT_NON_RANGE = 101,

File diff suppressed because one or more lines are too long

View File

@ -2142,6 +2142,7 @@ DEFINE_ORACLE_ERROR(OB_ERR_XML_PARENT_ALREADY_CONTAINS_CHILD, -7433, -1, "42000"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
DEFINE_ORACLE_ERROR_EXT_DEP(OB_ERR_INVALID_VECTOR_DIM, -7600, -1, "22000", "Invalid dimension for vector.", "inconsistent dimension: expected %u got %u", 932, "inconsistent dimension", "inconsistent dimension: expected %u got %u");
DEFINE_ERROR_EXT(OB_ERR_BAD_VEC_INDEX_COLUMN, -7601, -1, "HY000", "Column cannot be part of VECTOR index", "Column '%.*s' cannot be part of VECTOR index");
//
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -1497,6 +1497,7 @@ constexpr int OB_ERR_INVALID_XML_CHILD_NAME = -7429;
constexpr int OB_ERR_XML_NOT_SUPPORT_OPERATION = -7430;
constexpr int OB_ERR_COMPARE_VARRAY_LOB_ATTR = -7432;
constexpr int OB_ERR_XML_PARENT_ALREADY_CONTAINS_CHILD = -7433;
constexpr int OB_ERR_BAD_VEC_INDEX_COLUMN = -7601;
constexpr int OB_SERVER_IS_INIT = -8001;
constexpr int OB_SERVER_IS_STOPPING = -8002;
constexpr int OB_PACKET_CHECKSUM_ERROR = -8003;
@ -3721,6 +3722,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_COMPARE_VARRAY_LOB_ATTR__USER_ERROR_MSG "cannot compare VARRAY or LOB attributes of an object type"
#define OB_ERR_XML_PARENT_ALREADY_CONTAINS_CHILD__USER_ERROR_MSG "Parent %.*s already contains child entry %s%.*s"
#define OB_ERR_INVALID_VECTOR_DIM__USER_ERROR_MSG "inconsistent dimension: expected %u got %u"
#define OB_ERR_BAD_VEC_INDEX_COLUMN__USER_ERROR_MSG "Column '%.*s' cannot be part of VECTOR index"
#define OB_SERVER_IS_INIT__USER_ERROR_MSG "Server is initializing"
#define OB_SERVER_IS_STOPPING__USER_ERROR_MSG "Server is stopping"
#define OB_PACKET_CHECKSUM_ERROR__USER_ERROR_MSG "Packet checksum error"
@ -5989,6 +5991,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_COMPARE_VARRAY_LOB_ATTR__ORA_USER_ERROR_MSG "ORA-22901: cannot compare VARRAY or LOB attributes of an object type"
#define OB_ERR_XML_PARENT_ALREADY_CONTAINS_CHILD__ORA_USER_ERROR_MSG "ORA-31003: Parent %.*s already contains child entry %s%.*s"
#define OB_ERR_INVALID_VECTOR_DIM__ORA_USER_ERROR_MSG "ORA-00932: inconsistent dimension: expected %u got %u"
#define OB_ERR_BAD_VEC_INDEX_COLUMN__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -7601, Column '%.*s' cannot be part of VECTOR index"
#define OB_SERVER_IS_INIT__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -8001, Server is initializing"
#define OB_SERVER_IS_STOPPING__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -8002, Server is stopping"
#define OB_PACKET_CHECKSUM_ERROR__ORA_USER_ERROR_MSG "ORA-00600: internal error code, arguments: -8003, Packet checksum error"
@ -6427,7 +6430,7 @@ constexpr int OB_ERR_INVALID_DATE_MSG_FMT_V2 = -4219;
#define OB_ERR_DATA_TOO_LONG_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-12899: value too large for column %.*s (actual: %ld, maximum: %ld)"
#define OB_ERR_INVALID_DATE_MSG_FMT_V2__ORA_USER_ERROR_MSG "ORA-01861: Incorrect datetime value for column '%.*s' at row %ld"
extern int g_all_ob_errnos[2264];
extern int g_all_ob_errnos[2265];
const char *ob_error_name(const int oberr);
const char* ob_error_cause(const int oberr);

View File

@ -330,11 +330,16 @@ enum ObIndexType
// new index types for json multivalue index
INDEX_TYPE_NORMAL_MULTIVALUE_LOCAL = 23,
INDEX_TYPE_UNIQUE_MULTIVALUE_LOCAL = 24,
INDEX_TYPE_VEC_ROWKEY_VID_LOCAL = 25,
INDEX_TYPE_VEC_VID_ROWKEY_LOCAL = 26,
INDEX_TYPE_VEC_DELTA_BUFFER_LOCAL = 27,
INDEX_TYPE_VEC_INDEX_ID_LOCAL = 28,
INDEX_TYPE_VEC_INDEX_SNAPSHOT_DATA_LOCAL = 29,
/*
* Attention!!! when add new index type,
* need update func ObSimpleTableSchemaV2::should_not_validate_data_index_ckm()
*/
INDEX_TYPE_MAX = 25,
INDEX_TYPE_MAX = 30,
};
// using type for index
@ -694,6 +699,44 @@ inline bool is_fts_or_multivalue_index_aux(ObIndexType index_type)
return is_multivalue_index_aux(index_type) || is_fts_index_aux(index_type);
}
inline bool is_vec_rowkey_vid_type(const ObIndexType index_type)
{
return index_type == INDEX_TYPE_VEC_ROWKEY_VID_LOCAL;
}
inline bool is_vec_vid_rowkey_type(const ObIndexType index_type)
{
return index_type == INDEX_TYPE_VEC_VID_ROWKEY_LOCAL;
}
inline bool is_vec_delta_buffer_type(const ObIndexType index_type)
{
return index_type == INDEX_TYPE_VEC_DELTA_BUFFER_LOCAL;
}
inline bool is_vec_index_id_type(const ObIndexType index_type)
{
return index_type == INDEX_TYPE_VEC_INDEX_ID_LOCAL;
}
inline bool is_vec_index_snapshot_data_type(const ObIndexType index_type)
{
return index_type == INDEX_TYPE_VEC_INDEX_SNAPSHOT_DATA_LOCAL;
}
inline bool is_built_in_vec_index(const ObIndexType index_type)
{
return is_vec_rowkey_vid_type(index_type) ||
is_vec_vid_rowkey_type(index_type) ||
is_vec_delta_buffer_type(index_type) ||
is_vec_index_snapshot_data_type(index_type);
}
inline bool is_vec_index(const ObIndexType index_type)
{
return is_vec_index_id_type(index_type) || is_built_in_vec_index(index_type);
}
inline bool is_index_local_storage(ObIndexType index_type)
{
return INDEX_TYPE_NORMAL_LOCAL == index_type

View File

@ -2065,7 +2065,10 @@ inline bool ObSimpleTableSchemaV2::is_domain_index(const ObIndexType index_type)
return is_spatial_index(index_type) ||
share::schema::is_fts_index_aux(index_type) ||
share::schema::is_fts_doc_word_aux(index_type) ||
share::schema::is_multivalue_index_aux(index_type);
share::schema::is_multivalue_index_aux(index_type) ||
share::schema::is_vec_index_id_type(index_type) ||
share::schema::is_vec_delta_buffer_type(index_type) ||
share::schema::is_vec_index_snapshot_data_type(index_type);
}
inline bool ObSimpleTableSchemaV2::is_fts_or_multivalue_index() const

View File

@ -113,7 +113,8 @@ public:
SPATIAL_KEY = 2,
FTS_KEY = 3,
MULTI_KEY = 4,
MULTI_UNIQUE_KEY = 5
MULTI_UNIQUE_KEY = 5,
VEC_KEY = 6,
};
enum COLUMN_NODE {
COLUMN_REF_NODE = 0,