List of usage examples for com.amazonaws.services.glue.model StorageDescriptor getLocation
public String getLocation()
The physical location of the table.
From source file:com.facebook.presto.hive.metastore.glue.converter.GlueToPrestoConverter.java
License:Apache License
private static void setStorageBuilder(StorageDescriptor sd, Storage.Builder storageBuilder) { requireNonNull(sd.getSerdeInfo(), "StorageDescriptor SerDeInfo is null"); SerDeInfo serdeInfo = sd.getSerdeInfo(); Optional<HiveBucketProperty> bucketProperty = Optional.empty(); if (sd.getNumberOfBuckets() > 0) { if (isNullOrEmpty(sd.getBucketColumns())) { throw new PrestoException(HIVE_INVALID_METADATA, "Table/partition metadata has 'numBuckets' set, but 'bucketCols' is not set"); }/* ww w .j a v a 2 s.c o m*/ List<SortingColumn> sortedBy = ImmutableList.of(); if (!isNullOrEmpty(sd.getSortColumns())) { sortedBy = sd.getSortColumns().stream() .map(column -> new SortingColumn(column.getColumn(), Order.fromMetastoreApiOrder(column.getSortOrder(), "unknown"))) .collect(toImmutableList()); } bucketProperty = Optional .of(new HiveBucketProperty(sd.getBucketColumns(), sd.getNumberOfBuckets(), sortedBy)); } storageBuilder .setStorageFormat(StorageFormat.createNullable(serdeInfo.getSerializationLibrary(), sd.getInputFormat(), sd.getOutputFormat())) .setLocation(nullToEmpty(sd.getLocation())).setBucketProperty(bucketProperty) .setSkewed(sd.getSkewedInfo() != null && !isNullOrEmpty(sd.getSkewedInfo().getSkewedColumnNames())) .setSerdeParameters(firstNonNull(serdeInfo.getParameters(), ImmutableMap.of())).build(); }