public static Partition convertPartition()

in aws-glue-datacatalog-client-common/src/main/java/com/amazonaws/glue/catalog/converters/CatalogToHiveConverter.java [248:308]


  public static Partition convertPartition(com.amazonaws.services.glue.model.Partition src) {
	  Partition tgt = new Partition();
	  Date createTime = src.getCreationTime();
	  if (createTime != null) {
		  tgt.setCreateTime((int) (createTime.getTime() / 1000)); 
		  tgt.setCreateTimeIsSet(true);
	  } else {
		  tgt.setCreateTimeIsSet(false);
	  }
	  String dbName = src.getDatabaseName();
	  if (dbName != null) {
		  tgt.setDbName(dbName);
		  tgt.setDbNameIsSet(true);
	  } else {
		  tgt.setDbNameIsSet(false);
	  }
	  Date lastAccessTime = src.getLastAccessTime();
	  if (lastAccessTime != null) {
		  tgt.setLastAccessTime((int) (lastAccessTime.getTime() / 1000));
		  tgt.setLastAccessTimeIsSet(true);
	  } else {
		  tgt.setLastAccessTimeIsSet(false);
	  }
	  Map<String, String> params = src.getParameters();
	  
	  // A null parameter map causes Hive to throw a NPE
	  // so ensure we do not return a Partition object with a null parameter map.
	  if (params == null) {
	    params = Maps.newHashMap();
	  }
	  
	  tgt.setParameters(params);
	  tgt.setParametersIsSet(true);
	  
	  String tableName = src.getTableName();
	  if (tableName != null) {
		  tgt.setTableName(tableName);
		  tgt.setTableNameIsSet(true);
	  } else {
		  tgt.setTableNameIsSet(false);
	  }
	  
	  List<String> values = src.getValues();
	  if (values != null) {
		  tgt.setValues(values);
		  tgt.setValuesIsSet(true);
	  } else {
		  tgt.setValuesIsSet(false);
	  }
	  
	  com.amazonaws.services.glue.model.StorageDescriptor sd = src.getStorageDescriptor();
	  if (sd != null) {
		  StorageDescriptor hiveSd = convertStorageDescriptor(sd);
		  tgt.setSd(hiveSd);
		  tgt.setSdIsSet(true);
	  } else {
		  tgt.setSdIsSet(false);
	  }
	  
	  return tgt;
  }