mirror of https://github.com/citusdata/citus.git
Introduce ColumnarSupportsIndexAM
parent
d140ca1b0e
commit
eeecbd2324
|
@ -1863,9 +1863,7 @@ ColumnarProcessUtility(PlannedStmt *pstmt,
|
|||
GetCreateIndexRelationLockMode(indexStmt));
|
||||
if (rel->rd_tableam == GetColumnarTableAmRoutine())
|
||||
{
|
||||
/* for now, we don't support index access methods other than btree & hash */
|
||||
if (strncmp(indexStmt->accessMethod, "btree", NAMEDATALEN) != 0 &&
|
||||
strncmp(indexStmt->accessMethod, "hash", NAMEDATALEN) != 0)
|
||||
if (!ColumnarSupportsIndexAM(indexStmt->accessMethod))
|
||||
{
|
||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("only btree and hash indexes are supported on "
|
||||
|
@ -1881,6 +1879,18 @@ ColumnarProcessUtility(PlannedStmt *pstmt,
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* ColumnarSupportsIndexAM returns true if indexAM with given name is
|
||||
* supported by columnar tables.
|
||||
*/
|
||||
bool
|
||||
ColumnarSupportsIndexAM(char *indexAMName)
|
||||
{
|
||||
return strncmp(indexAMName, "btree", NAMEDATALEN) == 0 ||
|
||||
strncmp(indexAMName, "hash", NAMEDATALEN) == 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* IsColumnarTableAmTable returns true if relation has columnar_tableam
|
||||
* access method. This can be called before extension creation.
|
||||
|
|
|
@ -52,6 +52,7 @@ extern TableScanDesc columnar_beginscan_extended(Relation relation, Snapshot sna
|
|||
uint32 flags, Bitmapset *attr_needed,
|
||||
List *scanQual);
|
||||
extern int64 ColumnarScanChunkGroupsFiltered(TableScanDesc scanDesc);
|
||||
extern bool ColumnarSupportsIndexAM(char *indexAMName);
|
||||
extern bool IsColumnarTableAmTable(Oid relationId);
|
||||
extern TableDDLCommand * ColumnarGetTableOptionsDDL(Oid relationId);
|
||||
extern char * GetShardedTableDDLCommandColumnar(uint64 shardId, void *context);
|
||||
|
|
Loading…
Reference in New Issue