static TransactionMetaData findWriteIDForSynthetcRowIDs(Path splitPath, Path rootPath,
      Configuration conf) throws IOException {
      Path parent = splitPath.getParent();
      if(rootPath.equals(parent)) {
        //the 'isOriginal' file is at the root of the partition (or table) thus it is
        //from a pre-acid conversion write and belongs to primordial writeid:0.
        return new TransactionMetaData(0, parent);
      }
      while(parent != null && !rootPath.equals(parent)) {
        boolean isBase = parent.getName().startsWith(AcidUtils.BASE_PREFIX);
        boolean isDelta = parent.getName().startsWith(AcidUtils.DELTA_PREFIX)
            || parent.getName().startsWith(AcidUtils.DELETE_DELTA_PREFIX);
        if(isBase || isDelta) {
          if(isBase) {
            return new TransactionMetaData(AcidUtils.ParsedBaseLight.parseBase(parent).getWriteId(),
                parent);
          }
          else {
            AcidUtils.ParsedDeltaLight pd = AcidUtils.ParsedDeltaLight.parse(parent);
            return new TransactionMetaData(pd.getMinWriteId(), parent, pd.getStatementId());
          }
        }
        parent = parent.getParent();
      }
      if(parent == null) {
        //spit is marked isOriginal but it's not an immediate child of a partition nor is it in a
        //base/ or delta/ - this should never happen
        throw new IllegalStateException("Cannot determine write id for original file "
          + splitPath + " in " + rootPath);
      }
      //"warehouse/t/HIVE_UNION_SUBDIR_15/000000_0" is a meaningful path for nonAcid2acid
      // converted table
      return new TransactionMetaData(0, rootPath);
    }
folder which determines the write id to use in synthetic ROW_IDs
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRawRecordMerger.java