use of org.apache.carbondata.core.metadata.schema.table.RelationIdentifier in project carbondata by apache.
the class DataMapStoreManager method getAllDataMap.
/**
* It gives all datamaps except the default datamap.
*
* @return
*/
public List<TableDataMap> getAllDataMap(CarbonTable carbonTable) {
// TODO cache all schemas and update only when datamap status file updates
List<DataMapSchema> dataMapSchemas = getAllDataMapSchemas();
List<TableDataMap> dataMaps = new ArrayList<>();
if (dataMapSchemas != null) {
for (DataMapSchema dataMapSchema : dataMapSchemas) {
RelationIdentifier identifier = dataMapSchema.getParentTables().get(0);
if (dataMapSchema.isIndexDataMap() && identifier.getTableName().equals(carbonTable.getTableName()) && identifier.getDatabaseName().equals(carbonTable.getDatabaseName())) {
dataMaps.add(getDataMap(carbonTable, dataMapSchema));
}
}
}
return dataMaps;
}
use of org.apache.carbondata.core.metadata.schema.table.RelationIdentifier in project carbondata by apache.
the class AbstractDataFileFooterConverter method fromThriftToWrapperParentTableColumnRelations.
private List<ParentColumnTableRelation> fromThriftToWrapperParentTableColumnRelations(List<org.apache.carbondata.format.ParentColumnTableRelation> thirftParentColumnRelation) {
List<ParentColumnTableRelation> parentColumnTableRelationList = new ArrayList<>();
for (org.apache.carbondata.format.ParentColumnTableRelation carbonTableRelation : thirftParentColumnRelation) {
RelationIdentifier relationIdentifier = new RelationIdentifier(carbonTableRelation.getRelationIdentifier().getDatabaseName(), carbonTableRelation.getRelationIdentifier().getTableName(), carbonTableRelation.getRelationIdentifier().getTableId());
ParentColumnTableRelation parentColumnTableRelation = new ParentColumnTableRelation(relationIdentifier, carbonTableRelation.getColumnId(), carbonTableRelation.getColumnName());
parentColumnTableRelationList.add(parentColumnTableRelation);
}
return parentColumnTableRelationList;
}
use of org.apache.carbondata.core.metadata.schema.table.RelationIdentifier in project carbondata by apache.
the class ThriftWrapperSchemaConverterImpl method fromExternalToWrapperDataMapSchema.
@Override
public DataMapSchema fromExternalToWrapperDataMapSchema(org.apache.carbondata.format.DataMapSchema thriftDataMapSchema) {
DataMapSchema childSchema = new DataMapSchema(thriftDataMapSchema.getDataMapName(), thriftDataMapSchema.getClassName());
childSchema.setProperties(thriftDataMapSchema.getProperties());
if (null != thriftDataMapSchema.getChildTableIdentifier()) {
RelationIdentifier relationIdentifier = new RelationIdentifier(thriftDataMapSchema.getChildTableIdentifier().getDatabaseName(), thriftDataMapSchema.getChildTableIdentifier().getTableName(), thriftDataMapSchema.getChildTableIdentifier().getTableId());
childSchema.setRelationIdentifier(relationIdentifier);
childSchema.setChildSchema(fromExternalToWrapperTableSchema(thriftDataMapSchema.getChildTableSchema(), relationIdentifier.getTableName()));
}
return childSchema;
}
use of org.apache.carbondata.core.metadata.schema.table.RelationIdentifier in project carbondata by apache.
the class ThriftWrapperSchemaConverterImpl method fromWrapperToExternalChildSchemaList.
private List<org.apache.carbondata.format.DataMapSchema> fromWrapperToExternalChildSchemaList(List<DataMapSchema> wrapperChildSchemaList) {
List<org.apache.carbondata.format.DataMapSchema> thriftChildSchemas = new ArrayList<>();
for (DataMapSchema wrapperChildSchema : wrapperChildSchemaList) {
org.apache.carbondata.format.DataMapSchema thriftChildSchema = new org.apache.carbondata.format.DataMapSchema();
if (wrapperChildSchema.getRelationIdentifier() != null) {
org.apache.carbondata.format.RelationIdentifier relationIdentifier = new org.apache.carbondata.format.RelationIdentifier();
relationIdentifier.setDatabaseName(wrapperChildSchema.getRelationIdentifier().getDatabaseName());
relationIdentifier.setTableName(wrapperChildSchema.getRelationIdentifier().getTableName());
relationIdentifier.setTableId(wrapperChildSchema.getRelationIdentifier().getTableId());
thriftChildSchema.setChildTableIdentifier(relationIdentifier);
}
thriftChildSchema.setProperties(wrapperChildSchema.getProperties());
thriftChildSchema.setClassName(wrapperChildSchema.getProviderName());
thriftChildSchema.setDataMapName(wrapperChildSchema.getDataMapName());
if (wrapperChildSchema.getChildSchema() != null) {
thriftChildSchema.setChildTableSchema(fromWrapperToExternalTableSchema(wrapperChildSchema.getChildSchema()));
}
thriftChildSchemas.add(thriftChildSchema);
}
return thriftChildSchemas;
}
use of org.apache.carbondata.core.metadata.schema.table.RelationIdentifier in project carbondata by apache.
the class ThriftWrapperSchemaConverterImpl method fromExtrenalToWrapperParentTableColumnRelations.
private List<ParentColumnTableRelation> fromExtrenalToWrapperParentTableColumnRelations(List<org.apache.carbondata.format.ParentColumnTableRelation> thirftParentColumnRelation) {
List<ParentColumnTableRelation> parentColumnTableRelationList = new ArrayList<>();
for (org.apache.carbondata.format.ParentColumnTableRelation carbonTableRelation : thirftParentColumnRelation) {
RelationIdentifier relationIdentifier = new RelationIdentifier(carbonTableRelation.getRelationIdentifier().getDatabaseName(), carbonTableRelation.getRelationIdentifier().getTableName(), carbonTableRelation.getRelationIdentifier().getTableId());
ParentColumnTableRelation parentColumnTableRelation = new ParentColumnTableRelation(relationIdentifier, carbonTableRelation.getColumnId(), carbonTableRelation.getColumnName());
parentColumnTableRelationList.add(parentColumnTableRelation);
}
return parentColumnTableRelationList;
}
Aggregations