private static int getAcidVersionFromMetaFile(Path deltaOrBaseDir, FileSystem fs)
      throws IOException {
    Path formatFile = AcidUtils.OrcAcidVersion.getVersionFilePath(deltaOrBaseDir);
    try (FSDataInputStream inputStream = fs.open(formatFile)) {
      byte[] bytes = new byte[1];
      int read = inputStream.read(bytes);
      if (read != -1) {
        String version = new String(bytes, UTF8);
        return Integer.valueOf(version);
      }
      return ORC_ACID_VERSION_DEFAULT;
    } catch (FileNotFoundException fnf) {
      LOG.debug(formatFile + " not found, returning default: " + ORC_ACID_VERSION_DEFAULT);
      return ORC_ACID_VERSION_DEFAULT;
    } catch(IOException ex) {
      LOG.error(formatFile + " is unreadable due to: " + ex.getMessage(), ex);
      throw ex;
    }
  }
This is smart enough to handle streaming ingest where there could be a
{@link AcidUtils#DELTA_SIDE_FILE_SUFFIX} side file.
@param dataFile - ORC acid data file
@return version property from file if there,
         {@link #ORC_ACID_VERSION_DEFAULT} otherwise
ql/src/test/org/apache/hadoop/hive/ql/txn/compactor/CompactorTestUtilities.java