@SuppressWarnings("unchecked") private static boolean checkTextInputFormat(FileSystem fs, HiveConf conf, List<FileStatus> files) throws HiveException { List<FileStatus> files2 = new LinkedList<>(files); Iterator<FileStatus> iter = files2.iterator(); while (iter.hasNext()) { FileStatus file = iter.next(); if (file == null) continue; if (isPipe(fs, file)) { LOG.info("Skipping format check for " + file.getPath() + " as it is a pipe"); iter.remove(); } } if (files2.isEmpty()) return true; Set<Class<? extends InputFormat>> inputFormatter = FileChecker.getInstance().registeredTextClasses(); for (Class<? extends InputFormat> reg : inputFormatter) { boolean result = checkInputFormat(fs, conf, reg, files2); if (result) { return false; } } return true; }
@SuppressWarnings("unchecked") private static boolean checkTextInputFormat(FileSystem fs, HiveConf conf, List<FileStatus> files) throws HiveException { List<FileStatus> files2 = new LinkedList<>(files); Iterator<FileStatus> iter = files2.iterator(); while (iter.hasNext()) { FileStatus file = iter.next(); if (file == null) continue; if (isPipe(fs, file)) { LOG.info("Skipping format check for " + file.getPath() + " as it is a pipe"); iter.remove(); } } if (files2.isEmpty()) return true; Set<Class<? extends InputFormat>> inputFormatter = FileChecker.getInstance().registeredClasses(); for (Class<? extends InputFormat> reg : inputFormatter) { boolean result = checkInputFormat(fs, conf, reg, files2); if (result) { return false; } } return true; }
if (tbd.getPartitionSpec() == null || tbd.getPartitionSpec().isEmpty()) { flag = HiveFileFormatUtils.checkInputFormat( srcFs, conf, tbd.getTable().getInputFileFormatClass(), files); } else { flag = HiveFileFormatUtils.checkInputFormat( srcFs, conf, tbd.getTable().getInputFileFormatClass(), files); } else { flag = HiveFileFormatUtils.checkInputFormat( srcFs, conf, oldPart.getInputFormatClass(), files);
private void ensureFileFormatsMatch(TableSpec ts, List<FileStatus> fileStatuses, final URI fromURI) throws SemanticException { final Class<? extends InputFormat> destInputFormat; try { if (ts.getPartSpec() == null || ts.getPartSpec().isEmpty()) { destInputFormat = ts.tableHandle.getInputFormatClass(); } else { destInputFormat = ts.partHandle.getInputFormatClass(); } } catch (HiveException e) { throw new SemanticException(e); } try { FileSystem fs = FileSystem.get(fromURI, conf); boolean validFormat = HiveFileFormatUtils.checkInputFormat(fs, conf, destInputFormat, fileStatuses); if (!validFormat) { throw new SemanticException(ErrorMsg.INVALID_FILE_FORMAT_IN_LOAD.getMsg()); } } catch (Exception e) { throw new SemanticException("Unable to load data to destination table." + " Error: " + e.getMessage()); } }
private void ensureFileFormatsMatch(TableSpec ts, List<FileStatus> fileStatuses, final URI fromURI) throws SemanticException { final Class<? extends InputFormat> destInputFormat; try { if (ts.getPartSpec() == null || ts.getPartSpec().isEmpty()) { destInputFormat = ts.tableHandle.getInputFormatClass(); } else { destInputFormat = ts.partHandle.getInputFormatClass(); } } catch (HiveException e) { throw new SemanticException(e); } try { FileSystem fs = FileSystem.get(fromURI, conf); boolean validFormat = HiveFileFormatUtils.checkInputFormat(fs, conf, destInputFormat, fileStatuses); if (!validFormat) { throw new SemanticException(ErrorMsg.INVALID_FILE_FORMAT_IN_LOAD.getMsg()); } } catch (Exception e) { throw new SemanticException("Unable to load data to destination table." + " Error: " + e.getMessage()); } } }
if (tbd.getPartitionSpec() == null || tbd.getPartitionSpec().isEmpty()) { flag = HiveFileFormatUtils.checkInputFormat( srcFs, conf, tbd.getTable().getInputFileFormatClass(), files); } else { flag = HiveFileFormatUtils.checkInputFormat( srcFs, conf, tbd.getTable().getInputFileFormatClass(), files); } else { flag = HiveFileFormatUtils.checkInputFormat( srcFs, conf, oldPart.getInputFormatClass(), files);
@SuppressWarnings("unchecked") private static boolean checkTextInputFormat(FileSystem fs, HiveConf conf, ArrayList<FileStatus> files) throws HiveException { Set<Class<? extends InputFormat>> inputFormatter = inputFormatCheckerMap .keySet(); for (Class<? extends InputFormat> reg : inputFormatter) { boolean result = checkInputFormat(fs, conf, reg, files); if (result) { return false; } } return true; }
@SuppressWarnings("unchecked") private static boolean checkTextInputFormat(FileSystem fs, HiveConf conf, ArrayList<FileStatus> files) throws HiveException { Set<Class<? extends InputFormat>> inputFormatter = inputFormatCheckerMap .keySet(); for (Class<? extends InputFormat> reg : inputFormatter) { boolean result = checkInputFormat(fs, conf, reg, files); if (result) { return false; } } return true; }
boolean flag = HiveFileFormatUtils.checkInputFormat( fs, conf, tbd.getTable().getInputFileFormatClass(), files); if (!flag) {
boolean flag = HiveFileFormatUtils.checkInputFormat( srcFs, conf, tbd.getTable().getInputFileFormatClass(), files); if (!flag) {