本文整理汇总了C++中NAColumn类的典型用法代码示例。如果您正苦于以下问题:C++ NAColumn类的具体用法?C++ NAColumn怎么用?C++ NAColumn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NAColumn类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isIdentityColumnGeneratedAlways
NABoolean TableDesc::isIdentityColumnGeneratedAlways(NAString * value) const
{
// Determine if an IDENTITY column exists and
// has the default class of GENERATED ALWAYS AS IDENTITY.
// Do not return TRUE, if the table type is an INDEX_TABLE.
NABoolean result = FALSE;
for (CollIndex j = 0; j < colList_.entries(); j++)
{
ValueId valId = colList_[j];
NAColumn *column = valId.getNAColumn();
if(column->isIdentityColumnAlways())
{
if (getNATable()->getObjectType() != COM_INDEX_OBJECT)
{
if (value != NULL)
*value = column->getColName();
result = TRUE;
}
}
}
return result;
}
示例2: getNAColumn
// is this BaseColumn a primary or partitioning key and is val a single
// value or a constant that can be safely coerced to BaseColumn's type?
NABoolean BaseColumn::isKeyColumnValue(ItemExpr& val) const
{
NAColumn *baseCol = getNAColumn();
return
(baseCol != NULL &&
(baseCol->isPrimaryKey() || baseCol->isPartitioningKey()) &&
canSafelyCoerce(val));
}
示例3:
//gets the NAColumn that has the same position
NAColumn * NAColumnArray::getColumnByPos(Lng32 position) const
{
for (CollIndex i = 0; i < entries(); i++)
{
NAColumn *column = (*this)[i];
if (column->getPosition() == position) return column;
}
return NULL;
}
示例4: getSystemColumnList
// -----------------------------------------------------------------------
// TableDesc::getSystemColumnList()
// -----------------------------------------------------------------------
void TableDesc::getSystemColumnList(ValueIdList &columnList) const
{
for (CollIndex i = 0; i < colList_.entries(); i++) {
ValueId valId = colList_[i];
NAColumn *column = valId.getNAColumn();
if (column->isSystemColumn())
columnList.insert(valId);
}
}
示例5: removeByPosition
// LCOV_EXCL_START :cnu
// removes the column that has the same position
void NAColumnArray::removeByPosition(Lng32 position)
{
for(CollIndex i=0;i < entries();i++)
{
NAColumn * column = (*this)[i];
if(column->getPosition() == position)
{
this->removeAt(i);
break;
}
}
}
示例6: hasIdentityColumnInClusteringKey
NABoolean TableDesc::hasIdentityColumnInClusteringKey() const
{
ValueIdSet pKeyColumns = clusteringIndex_->getIndexKey();
NAColumn * column = NULL;
for(ValueId id = pKeyColumns.init(); pKeyColumns.next(id);
pKeyColumns.advance(id))
{
column = id.getNAColumn();
if (column && column->isIdentityColumn())
return TRUE;
}
return FALSE;
}
示例7: getIdentityColumn
// -----------------------------------------------------------------------
// TableDesc::getIdentityColumn()
// -----------------------------------------------------------------------
void TableDesc::getIdentityColumn(ValueIdList &columnList) const
{
for (CollIndex i = 0; i < colList_.entries(); i++)
{
ValueId valId = colList_[i];
NAColumn *column = valId.getNAColumn();
if (column->isIdentityColumn())
{
columnList.insert(valId);
break; // Break when you find the first,
// as there can only be one Identity column per table.
}
}
}
示例8: getMaxTrafHbaseColQualifier
ULng32 NAColumnArray::getMaxTrafHbaseColQualifier() const
{
NAColumn *column;
char * colQualPtr;
Lng32 colQualLen;
Int64 colQVal;
ULng32 maxVal = 0;
for (CollIndex i = 0; i < entries(); i++)
{
column = (*this)[i];
colQualPtr = (char*)column->getHbaseColQual().data();
colQualLen = column->getHbaseColQual().length();
colQVal = str_atoi(colQualPtr, colQualLen);
if (colQVal > maxVal)
maxVal = colQVal ;
}
return maxVal;
}
示例9: setPrimaryKeyColumns
// this method sets the primary key columns. It goes through all the columns
// of the table, and collects the columns which are marked as primary keys
void TableDesc::setPrimaryKeyColumns()
{
ValueIdSet primaryColumns;
for ( CollIndex j = 0 ; j < colList_.entries() ; j++ )
{
ValueId valId = colList_[j];
NAColumn *column = valId.getNAColumn();
if ( column->isPrimaryKey() )
{
primaryColumns.insert(valId) ;
// mark column as referenced for histogram, as we may need its histogram
// during plan generation
if ((column->isUserColumn() || column->isSaltColumn() ) &&
(column->getNATable()->getSpecialType() == ExtendedQualName::NORMAL_TABLE) )
column->setReferencedForMultiIntHist();
}
}
primaryKeyColumns_ = primaryColumns;
}
示例10: return
NABoolean NAColumn::operator==(const NAColumn& other) const
{
return ((getColName() == other.getColName()) &&
(*getType() == *other.getType()));
}
示例11: colStats
//.........这里部分代码省略.........
const ColStatDescList & outerColStatsList = inputEstLogProp->getColStats();
ValueIdSet colsRequiringHistograms = specifiedOutputs;
// (i) see if the selection predicates contain any constant value or a
// constant expression
// (ii) check if there are any columns of this table being joined to some other
// columns, which do not appear as characteristics outputs. There should be
// histograms available for these columns, as these might be needed later.
// This problem was seen for temporary tables created as normal_tables by the
// triggers.
colsRequiringHistograms.addSet(predSet.getColumnsForHistogram());
colStats().setMCSkewedValueLists(columnStats.getMCSkewedValueLists()) ;
NABoolean colStatDescAdded = FALSE;
for (CollIndex i=0; i < columnStats.entries(); i++)
{
// we probably don't need 'em all, but this is the easiest way to
// grab all of the multi-column uec information we'll need later
colStats().insertIntoUecList (columnStats.getUecList()) ;
colStats().setScanRowCountWithoutHint(columnStats.getScanRowCountWithoutHint());
NABoolean found = FALSE;
// Note: The following inserts into a ColStatDescList should not
// have to be deep copies. From this point on, ColStatDescs that
// describe the output of the calling operator are read-only.
ColStatDescSharedPtr colStatDesc = columnStats[i];
// the value-id we're looking for
const ValueId columnId = colStatDesc->getVEGColumn() ;
for (CollIndex j=0 ; j < outerColStatsList.entries() ; j++)
{
if (columnId == outerColStatsList[j]->getVEGColumn() OR
(CmpCommon::context()->showQueryStats()))
{
colStats().insert(colStatDesc) ;
found = TRUE;
if(!colStatDescAdded)
colStatDescAdded = TRUE;
break ; // jump to next ColStatDesc
}
}
// OK, the valueid doesn't match directly -- but there are still a
// couple of things to check in order to verify whether or not we're
// interested in keeping the i'th ColStatDesc ...
ValueId throwaway ; // used by the second clause below
if ( NOT found AND
(columnId != NULL_VALUE_ID) AND
(colsRequiringHistograms.contains (columnId) OR
colsRequiringHistograms.referencesTheGivenValue (columnId, throwaway) OR
columnId.isInvolvedInJoinAndConst() OR
CmpCommon::context()->showQueryStats() )
)
{
colStats().insert(colStatDesc);
found = TRUE;
if(!colStatDescAdded)
colStatDescAdded = TRUE;
}
if (CURRSTMT_OPTDEFAULTS->incorporateSkewInCosting())
{
// if the column is referenced for histogram, but is
// not needed beyond this time , then we shall save its
// max freq, which might be used later in costing if this
// column is a part of the partitioning key
ColStatsSharedPtr stat = colStatDesc->getColStats();
if (!(stat->isVirtualColForHist() ) && NOT found &&
!(stat->isOrigFakeHist() ) )
{
const ValueId col = colStatDesc->getColumn();
ColAnalysis * colAnalysis = col.colAnalysis();
if (colAnalysis)
{
NAColumn * column = stat->getStatColumns()[0];
if (column->isReferencedForHistogram())
{
CostScalar maxFreq = columnStats.getMaxFreq(columnId);
colAnalysis->setMaxFreq(maxFreq);
colAnalysis->setFinalUec(stat->getTotalUec());
colAnalysis->setFinalRC(stat->getRowcount());
}
}
}
}
} // for columnStats.entries()
if(!colStatDescAdded && columnStats.entries() > 0)
colStats().insert(columnStats[0]) ;
} // pickOutputs