class PartitionUtils {

    public static List<AnalyticsTablePartition> getTablePartitions( List<AnalyticsTable> tables )
    {
        final List<AnalyticsTablePartition> partitions = Lists.newArrayList();

        for ( AnalyticsTable table : tables )
        {
            if ( table.hasPartitionTables() )
            {
                partitions.addAll( table.getTablePartitions() );
            }
            else
            {
                // Fake partition representing the master table

                partitions.add( new AnalyticsTablePartition( table, null, null, null, false ) );
            }
        }

        return partitions;
    }

}