本文整理汇总了C++中TupleSchema::columnType方法的典型用法代码示例。如果您正苦于以下问题:C++ TupleSchema::columnType方法的具体用法?C++ TupleSchema::columnType怎么用?C++ TupleSchema::columnType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TupleSchema
的用法示例。
在下文中一共展示了TupleSchema::columnType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initTable
TEST_F(TupleSchemaTest, CreateEvictedTupleSchema) {
initTable(true);
// Create the TupleSchema for our evicted tuple tables
// The first columns should be all of the columns of our primary key index
TupleSchema *evictedSchema = TupleSchema::createEvictedTupleSchema();
// fprintf(stdout, "\nEVICTED TABLE SCHEMA\n%s\n", evictedSchema->debug().c_str());
ASSERT_EQ(2, evictedSchema->columnCount());
ASSERT_EQ(VALUE_TYPE_SMALLINT, evictedSchema->columnType(0));
ASSERT_EQ(VALUE_TYPE_INTEGER, evictedSchema->columnType(1));
TupleSchema::freeTupleSchema(evictedSchema);
}
示例2: initTable
TEST_F(TupleSchemaTest, CreateEvictedTupleSchema) {
initTable(true);
// Create the TupleSchema for our evicted tuple tables
// The first columns should be all of the columns of our primary key index
TupleSchema *evictedSchema = TupleSchema::createEvictedTupleSchema(m_primaryKeyIndexSchema);
// fprintf(stdout, "\nEVICTED TABLE SCHEMA\n%s\n", evictedSchema->debug().c_str());
ASSERT_EQ(m_numPrimaryKeyCols+1, evictedSchema->columnCount());
for (int i = 0; i < m_numPrimaryKeyCols; i++) {
ASSERT_EQ(m_primaryKeyIndexSchema->columnType(i), evictedSchema->columnType(i));
ASSERT_EQ(m_primaryKeyIndexSchema->columnLength(i), evictedSchema->columnLength(i));
ASSERT_EQ(m_primaryKeyIndexSchema->columnAllowNull(i), evictedSchema->columnAllowNull(i));
}
// Then there should only be one more column that contains the 16-bit block ids
ASSERT_EQ(VALUE_TYPE_SMALLINT, evictedSchema->columnType(m_numPrimaryKeyCols));
ASSERT_FALSE(evictedSchema->columnAllowNull(m_numPrimaryKeyCols));
TupleSchema::freeTupleSchema(evictedSchema);
}
示例3: picker
TableIndex *TableIndexFactory::getInstance(const TableIndexScheme &scheme) {
int colCount = (int)scheme.columnIndices.size();
TupleSchema *tupleSchema = scheme.tupleSchema;
assert(tupleSchema);
std::vector<ValueType> keyColumnTypes;
std::vector<int32_t> keyColumnLengths;
std::vector<bool> keyColumnAllowNull(colCount, true);
for (int i = 0; i < colCount; ++i) {
keyColumnTypes.push_back(tupleSchema->columnType(scheme.columnIndices[i]));
keyColumnLengths.push_back(tupleSchema->columnLength(scheme.columnIndices[i]));
}
TupleSchema *keySchema = TupleSchema::createTupleSchema(keyColumnTypes, keyColumnLengths, keyColumnAllowNull, true);
assert(keySchema);
VOLT_TRACE("Creating index for %s.\n%s", scheme.name.c_str(), keySchema->debug().c_str());
TableIndexPicker picker(keySchema, scheme);
TableIndex *retval = picker.getInstance();
return retval;
}