partitionInfo.setSerde(new StorageInfo()); if (partitionInfo.getAudit() == null) { partitionInfo.setAudit(new AuditInfo()); final Partition existingPartition = existingPartitionHolder.getPartition(); partitionInfo.getSerde().setParameters(existingPartition.getParameters()); partitionInfo.getAudit().setCreatedDate( HiveConnectorInfoConverter.epochSecondsToDate(existingPartition.getCreateTime())); partitionInfo.getAudit().setLastModifiedDate( HiveConnectorInfoConverter.epochSecondsToDate(existingPartition.getLastAccessTime())); } else { .setParameters(existingPartitionInfo.getSerde().getParameters()); if (existingPartitionInfo.getAudit() != null) { partitionInfo.getAudit() .setCreatedDate(existingPartitionInfo.getAudit().getCreatedDate()); partitionInfo.getAudit() .setLastModifiedDate(existingPartitionInfo.getAudit().getLastModifiedDate());
partitionInfo.setSerde(new StorageInfo()); if (partitionInfo.getAudit() == null) { partitionInfo.setAudit(new AuditInfo()); final Partition existingPartition = existingPartitionHolder.getPartition(); partitionInfo.getSerde().setParameters(existingPartition.getParameters()); partitionInfo.getAudit().setCreatedDate( HiveConnectorInfoConverter.epochSecondsToDate(existingPartition.getCreateTime())); partitionInfo.getAudit().setLastModifiedDate( HiveConnectorInfoConverter.epochSecondsToDate(existingPartition.getLastAccessTime())); } else { .setParameters(existingPartitionInfo.getSerde().getParameters()); if (existingPartitionInfo.getAudit() != null) { partitionInfo.getAudit() .setCreatedDate(existingPartitionInfo.getAudit().getCreatedDate()); partitionInfo.getAudit() .setLastModifiedDate(existingPartitionInfo.getAudit().getLastModifiedDate());
sd.getSerdeInfo().setSerializationLib(tableInfo.getSerde().getSerializationLib()); final AuditInfo auditInfo = partition.getAudit(); final int createTime = (notNull(auditInfo) && notNull(auditInfo.getCreatedDate())) ? dateToEpochSeconds(auditInfo.getCreatedDate()) : 0;
sd.getSerdeInfo().setSerializationLib(tableInfo.getSerde().getSerializationLib()); final AuditInfo auditInfo = partition.getAudit(); final int createTime = (notNull(auditInfo) && notNull(auditInfo.getCreatedDate())) ? dateToEpochSeconds(auditInfo.getCreatedDate()) : 0;
/** * Converts from partition info to s3 partition object. * @param partitionInfo partition info * @return s3 partition */ Partition fromPartitionInfo(final PartitionInfo partitionInfo) { final Partition result = new Partition(); result.setName(partitionInfo.getName().getPartitionName()); result.setUri(partitionInfo.getSerde().getUri()); final AuditInfo auditInfo = partitionInfo.getAudit(); if (auditInfo != null) { result.setCreatedDate(auditInfo.getCreatedDate()); result.setLastUpdatedDate(auditInfo.getLastModifiedDate()); } return result; }