@Override
    public PartitionFiles next() {
      try {
        Partition p = partitionIter.next();
        Iterator<String> fileIterator;
        //For transactional tables, the actual file copy will be done by acid write event during replay of commit txn.
        if (!TxnUtils.isTransactionalTable(t)) {
          List<String> files = Lists.newArrayList(new FileIterator(p.getSd().getLocation()));
          fileIterator = files.iterator();
        } else {
          fileIterator = Collections.emptyIterator();
        }
        PartitionFiles partitionFiles =
            new PartitionFiles(Warehouse.makePartName(t.getPartitionKeys(), p.getValues()), fileIterator);
        return partitionFiles;
      } catch (MetaException e) {
        throw new RuntimeException(e);
      }
    }
Filter for valid files only (no dir, no hidden)
hcatalog/server-extensions/src/main/java/org/apache/hive/hcatalog/listener/DbNotificationListener.java