/** * Get the types of primary key (partitioning key) fields * * @param datasetDetails, * contains specific data structures for an internal dataset. * @param recordType, * the main record type. * @param metaRecordType * the auxiliary meta record type. * @return a list of IATypes, one for each corresponding primary key field. * @throws AlgebricksException */ public static List<IAType> getPartitioningKeyTypes(InternalDatasetDetails datasetDetails, ARecordType recordType, ARecordType metaRecordType) throws AlgebricksException { List<Integer> keySourceIndicators = datasetDetails.getKeySourceIndicator(); List<List<String>> partitioningKeys = datasetDetails.getPartitioningKey(); return getKeyTypes(recordType, metaRecordType, partitioningKeys, keySourceIndicators); }
@Override public List<List<String>> getPrimaryKeys() { if (getDatasetType() == DatasetType.EXTERNAL) { return IndexingConstants.getRIDKeys(((ExternalDatasetDetails) getDatasetDetails()).getProperties()); } return ((InternalDatasetDetails) getDatasetDetails()).getPartitioningKey(); }
public static Index getPrimaryIndex(Dataset dataset) { InternalDatasetDetails id = (InternalDatasetDetails) dataset.getDatasetDetails(); return new Index(dataset.getDataverseName(), dataset.getDatasetName(), dataset.getDatasetName(), DatasetConfig.IndexType.BTREE, id.getPartitioningKey(), id.getKeySourceIndicator(), id.getPrimaryKeyType(), false, false, true, dataset.getPendingOp()); }
keyAccessScalarFunctionCallExpression = new ArrayList<>(); pkTypes = ((InternalDatasetDetails) dataset.getDatasetDetails()).getPrimaryKeyType(); partitioningKeys = ((InternalDatasetDetails) dataset.getDatasetDetails()).getPartitioningKey(); if (dataset.hasMetaPart()) { keySourceIndicator = ((InternalDatasetDetails) dataset.getDatasetDetails()).getKeySourceIndicator();