Search in sources :

Example 6 with StorageDto

use of com.netflix.metacat.common.dto.StorageDto in project metacat by Netflix.

the class MViewServiceImpl method mergePartition.

private PartitionDto mergePartition(final PartitionDto partitionDto, @Nullable final PartitionDto existingPartition) {
    if (existingPartition != null) {
        final StorageDto existingSerde = existingPartition.getSerde();
        if (existingSerde != null) {
            StorageDto serde = partitionDto.getSerde();
            if (serde == null) {
                serde = new StorageDto();
                partitionDto.setSerde(serde);
            }
            if (serde.getUri() == null || serde.getUri().equals(existingSerde.getUri())) {
                serde.setUri(existingSerde.getUri());
                if (serde.getInputFormat() == null) {
                    serde.setInputFormat(existingSerde.getInputFormat());
                }
                if (serde.getOutputFormat() == null) {
                    serde.setOutputFormat(existingSerde.getOutputFormat());
                }
                if (serde.getSerializationLib() == null) {
                    serde.setSerializationLib(existingSerde.getSerializationLib());
                }
            }
        }
    }
    return partitionDto;
}
Also used : StorageDto(com.netflix.metacat.common.dto.StorageDto)

Aggregations

StorageDto (com.netflix.metacat.common.dto.StorageDto)6 QualifiedName (com.netflix.metacat.common.QualifiedName)2 AuditDto (com.netflix.metacat.common.dto.AuditDto)1 DatabaseDto (com.netflix.metacat.common.dto.DatabaseDto)1 FieldDto (com.netflix.metacat.common.dto.FieldDto)1 PartitionDto (com.netflix.metacat.common.dto.PartitionDto)1 PartitionsSaveRequestDto (com.netflix.metacat.common.dto.PartitionsSaveRequestDto)1 TableDto (com.netflix.metacat.common.dto.TableDto)1 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 FieldSchema (org.apache.hadoop.hive.metastore.api.FieldSchema)1 SerDeInfo (org.apache.hadoop.hive.metastore.api.SerDeInfo)1 StorageDescriptor (org.apache.hadoop.hive.metastore.api.StorageDescriptor)1 Table (org.apache.hadoop.hive.metastore.api.Table)1