presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/file/TableMetadata.java/TableMetadata/TableMetadata
class TableMetadata:    public TableMetadata(Table table, Map<String, HiveColumnStatistics> columnStatistics)
    {
        owner = table.getOwner();
        tableType = table.getTableType();
        dataColumns = table.getDataColumns();
        partitionColumns = table.getPartitionColumns();
        parameters = table.getParameters();

        StorageFormat tableFormat = table.getStorage().getStorageFormat();
        storageFormat = Arrays.stream(HiveStorageFormat.values())
                .filter(format -> tableFormat.equals(StorageFormat.fromHiveStorageFormat(format)))
                .findFirst();
        bucketProperty = table.getStorage().getBucketProperty();
        serdeParameters = table.getStorage().getSerdeParameters();

        if (tableType.equals(TableType.EXTERNAL_TABLE.name())) {
            externalLocation = Optional.of(table.getStorage().getLocation());
        }
        else {
            externalLocation = Optional.empty();
        }

        viewOriginalText = table.getViewOriginalText();
        viewExpandedText = table.getViewExpandedText();
        this.columnStatistics = ImmutableMap.copyOf(requireNonNull(columnStatistics, "columnStatistics is null"));
    }