presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/metadata/ShardDao.java/ShardDao/getNodeSizes
class ShardDao:    @SqlQuery("SELECT n.node_identifier, x.bytes\n" +
            "FROM (\n" +
            "  SELECT node_id, sum(compressed_size) bytes\n" +
            "  FROM (\n" +
            "      SELECT sn.node_id, s.compressed_size\n" +
            "      FROM shards s\n" +
            "      JOIN shard_nodes sn ON (s.shard_id = sn.shard_id)\n" +
            "      WHERE s.bucket_number IS NULL\n" +
            "    UNION ALL\n" +
            "      SELECT b.node_id, s.compressed_size\n" +
            "      FROM shards s\n" +
            "      JOIN tables t ON (s.table_id = t.table_id)\n" +
            "      JOIN distributions d ON (t.distribution_id = d.distribution_id)\n" +
            "      JOIN buckets b ON (\n" +
            "        d.distribution_id = b.distribution_id AND\n" +
            "        s.bucket_number = b.bucket_number)\n" +
            "  ) x\n" +
            "  GROUP BY node_id\n" +
            ") x\n" +
            "JOIN nodes n ON (x.node_id = n.node_id)")
    @Mapper(NodeSize.Mapper.class)
    Set<NodeSize> getNodeSizes();