private static void validateAcidFiles(FileStatus[] srcs, FileSystem fs) throws SemanticException { try { for (FileStatus oneSrc : srcs) { if (!AcidUtils.MetaDataFile.isRawFormatFile(oneSrc.getPath(), fs)) { throw new SemanticException(ErrorMsg.LOAD_DATA_ACID_FILE, oneSrc.getPath().toString()); } } } catch (IOException ex) { throw new SemanticException(ex); } }
/** * Checks if the files in base/delta dir are a result of Load Data statement and thus do not * have ROW_IDs embedded in the data. * @param baseOrDeltaDir base or delta file. */ public static boolean isRawFormat(Path baseOrDeltaDir, FileSystem fs) throws IOException { Path dataFile = chooseFile(baseOrDeltaDir, fs); if (dataFile == null) { //directory is empty or doesn't have any that could have been produced by load data return false; } return isRawFormatFile(dataFile, fs); } public static boolean isRawFormatFile(Path dataFile, FileSystem fs) throws IOException {