final String location = notNull(storageInfo.getUri()) ? storageInfo.getUri() : ""; final String outputFormat = storageInfo.getOutputFormat(); final Map<String, String> sdParams = notNull(storageInfo.getParameters()) ? storageInfo.getParameters() : new HashMap<>(); final Map<String, String> serdeParams = notNull(storageInfo.getSerdeInfoParameters()) ? storageInfo.getSerdeInfoParameters() : new HashMap<>();
final String location = notNull(storageInfo.getUri()) ? storageInfo.getUri() : ""; final String outputFormat = storageInfo.getOutputFormat(); final Map<String, String> sdParams = notNull(storageInfo.getParameters()) ? storageInfo.getParameters() : new HashMap<>(); final Map<String, String> serdeParams = notNull(storageInfo.getSerdeInfoParameters()) ? storageInfo.getSerdeInfoParameters() : new HashMap<>();
private void copyTableSdToPartitionInfoSd(final PartitionInfo partitionInfo, final Table table) { StorageInfo sd = partitionInfo.getSerde(); // // Partitions can be provided in the request without the storage information. // if (sd == null) { sd = new StorageInfo(); partitionInfo.setSerde(sd); } final StorageDescriptor tableSd = table.getSd(); if (StringUtils.isBlank(sd.getInputFormat())) { sd.setInputFormat(tableSd.getInputFormat()); } if (StringUtils.isBlank(sd.getOutputFormat())) { sd.setOutputFormat(tableSd.getOutputFormat()); } if (sd.getParameters() == null || sd.getParameters().isEmpty()) { sd.setParameters(tableSd.getParameters()); } final SerDeInfo tableSerde = tableSd.getSerdeInfo(); if (tableSerde != null) { if (StringUtils.isBlank(sd.getSerializationLib())) { sd.setSerializationLib(tableSerde.getSerializationLib()); } if (sd.getSerdeInfoParameters() == null || sd.getSerdeInfoParameters().isEmpty()) { sd.setSerdeInfoParameters(tableSerde.getParameters()); } } }
/** * Converts from storage info to s3 location. * @param storageInfo storage info * @return location */ Location fromStorageInfo(final StorageInfo storageInfo) { final Location result = new Location(); if (storageInfo != null) { result.setUri(storageInfo.getUri()); final Info info = new Info(); info.setLocation(result); info.setOwner(storageInfo.getOwner()); info.setInputFormat(storageInfo.getInputFormat()); info.setOutputFormat(storageInfo.getOutputFormat()); info.setSerializationLib(storageInfo.getSerializationLib()); final Map<String, String> parameters = Maps.newHashMap(); if (storageInfo.getParameters() != null) { parameters.putAll(storageInfo.getParameters()); } if (storageInfo.getSerdeInfoParameters() != null) { parameters.putAll(storageInfo.getSerdeInfoParameters()); } info.setParameters(parameters); result.setInfo(info); } return result; }
private void copyTableSdToPartitionInfoSd(final PartitionInfo partitionInfo, final Table table) { StorageInfo sd = partitionInfo.getSerde(); // // Partitions can be provided in the request without the storage information. // if (sd == null) { sd = new StorageInfo(); partitionInfo.setSerde(sd); } final StorageDescriptor tableSd = table.getSd(); if (StringUtils.isBlank(sd.getInputFormat())) { sd.setInputFormat(tableSd.getInputFormat()); } if (StringUtils.isBlank(sd.getOutputFormat())) { sd.setOutputFormat(tableSd.getOutputFormat()); } if (sd.getParameters() == null || sd.getParameters().isEmpty()) { sd.setParameters(tableSd.getParameters()); } final SerDeInfo tableSerde = tableSd.getSerdeInfo(); if (tableSerde != null) { if (StringUtils.isBlank(sd.getSerializationLib())) { sd.setSerializationLib(tableSerde.getSerializationLib()); } if (sd.getSerdeInfoParameters() == null || sd.getSerdeInfoParameters().isEmpty()) { sd.setSerdeInfoParameters(tableSerde.getParameters()); } } }
if (storageInfo.getParameters() != null && !storageInfo.getParameters().isEmpty()) { sdParameters = storageInfo.getParameters();
if (storageInfo.getParameters() != null && !storageInfo.getParameters().isEmpty()) { sdParameters = storageInfo.getParameters();
if (existingPartitionInfo.getSerde() != null) { partitionInfo.getSerde() .setParameters(existingPartitionInfo.getSerde().getParameters());
if (existingPartitionInfo.getSerde() != null) { partitionInfo.getSerde() .setParameters(existingPartitionInfo.getSerde().getParameters());