private void checkPartitionProperties(Partition partition) throws MetaException {
    if (partition.getDbName() == null) {
      throw new MetaException("Database name cannot be null. " + partition);
    }
    if (partition.getTableName() == null) {
      throw new MetaException("Table name cannot be null. " + partition);
    }
    if (partition.getValues() == null) {
      throw new MetaException("Partition values cannot be null. " + partition);
    }
    if (partition.getSd() == null) {
      throw new MetaException("Storage descriptor for partition cannot be null. " + partition);
    }
    if (partition.getSd().getCols() == null) {
      // not sure this is correct, but it is possible to add a partition without column information.
      return;
    }

    for (FieldSchema schema : partition.getSd().getCols()) {
      if (schema.getType() == null) {
        throw new MetaException("Storage descriptor column type for partition cannot be null. " + partition);
      }
      if (schema.getName() == null) {
        throw new MetaException("Storage descriptor column name for partition cannot be null. " + partition);
      }
    }
    if (partition.getSd().getSerdeInfo() == null) {
      throw new MetaException("Storage descriptor serde info for partition cannot be null. " + partition);
    }
  }
Checking the validity of some partition properties (values, storage descriptor, columns, serdeinfo).

@param partition an instance of the partition, must be not null
@throws MetaException if some check is failing
ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java