/** * Get the types of BTree index key fields * * @param index, * the index to consider. * @param recordType, * the main record type. * @param metaRecordType * the auxiliary meta record type. * @return a list of IATypes, one for each corresponding index key field. * @throws AlgebricksException */ public static List<IAType> getBTreeIndexKeyTypes(Index index, ARecordType recordType, ARecordType metaRecordType) throws AlgebricksException { List<Integer> keySourceIndicators = index.getKeyFieldSourceIndicators(); List<IAType> indexKeyTypes = new ArrayList<>(); for (int i = 0; i < index.getKeyFieldNames().size(); i++) { Pair<IAType, Boolean> keyPairType = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(i), index.getKeyFieldNames().get(i), chooseSource(keySourceIndicators, i, recordType, metaRecordType)); indexKeyTypes.add(keyPairType.first); } return indexKeyTypes; }
for (; i < sidxKeyFieldCount; ++i) { Pair<IAType, Boolean> keyPairType = Index.getNonNullableOpenFieldType(sidxKeyFieldTypes.get(i), sidxKeyFieldNames.get(i), (hasMeta && secondaryIndexIndicators.get(i).intValue() == 1) ? metaType : recType); IAType keyType = keyPairType.first;
/** * Get the types of RTree index key fields * * @param index, * the index to consider. * @param recordType, * the main record type. * @param metaRecordType * the auxiliary meta record type. * @return a list of IATypes, one for each corresponding index key field. * @throws AlgebricksException */ public static List<IAType> getRTreeIndexKeyTypes(Index index, ARecordType recordType, ARecordType metaRecordType) throws AlgebricksException { List<Integer> keySourceIndicators = index.getKeyFieldSourceIndicators(); List<IAType> indexKeyTypes = new ArrayList<>(); ARecordType targetRecType = chooseSource(keySourceIndicators, 0, recordType, metaRecordType); Pair<IAType, Boolean> keyPairType = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(0), index.getKeyFieldNames().get(0), targetRecType); IAType keyType = keyPairType.first; IAType nestedKeyType = NonTaggedFormatUtil.getNestedSpatialType(keyType.getTypeTag()); int numKeys = KeyFieldTypeUtil.getNumSecondaryKeys(index, targetRecType, metaRecordType); for (int i = 0; i < numKeys; i++) { indexKeyTypes.add(nestedKeyType); } return indexKeyTypes; }
sourceType = metaType; Pair<IAType, Boolean> keyTypePair = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(i), index.getKeyFieldNames().get(i), sourceType); IAType keyType = keyTypePair.first;
sourceType = metaType; Pair<IAType, Boolean> keyTypePair = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(0), index.getKeyFieldNames().get(0), sourceType); IAType secondaryKeyType = keyTypePair.first;
sourceType = metaType; Pair<IAType, Boolean> spatialTypePair = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(0), secondaryKeyFields.get(0), sourceType); IAType spatialType = spatialTypePair.first;
sourceType = metaType; Pair<IAType, Boolean> spatialTypePair = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(0), secondaryKeyFields.get(0), sourceType); IAType spatialType = spatialTypePair.first;
return index.getKeyFieldNames().size(); case RTREE: Pair<IAType, Boolean> keyPairType = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(0), index.getKeyFieldNames().get(0), chooseSource(keySourceIndicators, 0, recordType, metaRecordType));
sourceType = metaType; Pair<IAType, Boolean> keyTypePair = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(0), index.getKeyFieldNames().get(0), sourceType); IAType secondaryKeyType = keyTypePair.first;
sourceType = metaType; Pair<IAType, Boolean> keyTypePair = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(0), index.getKeyFieldNames().get(0), sourceType); IAType secondaryKeyType = keyTypePair.first;
sourceType = metaType; Pair<IAType, Boolean> keyTypePair = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(i), index.getKeyFieldNames().get(i), sourceType); IAType keyType = keyTypePair.first;
sourceType = metaType; Pair<IAType, Boolean> keyTypePair = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(i), index.getKeyFieldNames().get(i), sourceType); IAType keyType = keyTypePair.first;
sourceType = metaType; Pair<IAType, Boolean> keyTypePair = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(i), index.getKeyFieldNames().get(i), sourceType); IAType keyType = keyTypePair.first;
List<IAType> secondaryKeyTypes = secondaryIndex.getKeyFieldTypes(); Pair<IAType, Boolean> keyPairType = Index.getNonNullableOpenFieldType(secondaryKeyTypes.get(0), secondaryKeyExprs.get(0), recType); IAType spatialType = keyPairType.first; int dimension = NonTaggedFormatUtil.getNumDimensions(spatialType.getTypeTag());
Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(0), secondaryKeyFields.get(0), itemType); IAType spatialType = spatialTypePair.first; anySecondaryKeyIsNullable = spatialTypePair.second;
List<IAType> secondaryKeyTypes = secondaryIndex.getKeyFieldTypes(); Pair<IAType, Boolean> keyTypePair = Index.getNonNullableOpenFieldType(secondaryKeyTypes.get(0), secondaryKeyFields.get(0), recType); IAType keyType = keyTypePair.first; int numDimensions = NonTaggedFormatUtil.getNumDimensions(keyType.getTypeTag());
Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(0), secondaryKeyFields.get(0), itemType); IAType spatialType = spatialTypePair.first; anySecondaryKeyIsNullable = spatialTypePair.second;
metadataProvider.getFunctionManager(), isOverridingKeyTypes ? enforcedItemType : sourceType, index.getKeyFieldNames().get(i), sourceColumn, sourceLoc); Pair<IAType, Boolean> keyTypePair = Index.getNonNullableOpenFieldType(index.getKeyFieldTypes().get(i), index.getKeyFieldNames().get(i), sourceType); IAType keyType = keyTypePair.first;
IAType optFieldType = optFuncExpr.getFieldType(optFieldIdx); List<String> optFieldName = optFuncExpr.getFieldName(optFieldIdx); Pair<IAType, Boolean> keyPairType = Index.getNonNullableOpenFieldType(optFieldType, optFieldName, recordType); if (keyPairType == null) { return null;
Pair<IAType, Boolean> keyPairType = Index.getNonNullableOpenFieldType(optFuncExpr.getFieldType(optFieldIdx), optFuncExpr.getFieldName(optFieldIdx), recordType); if (keyPairType == null) {