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