Exception thrown for dataset reader-related failures.
Implementations of the {@link DatasetReader} interface throw this exceptionif any of their operations fail. This is a runtime (unchecked) exception.
128129130131132133134135136137138
FSDataInputStream incoming; try { incoming = fs.open(path); } catch (IOException ex) { throw new DatasetReaderException("Cannot open path: " + path, ex); } this.reader = new CSVReader( new InputStreamReader(incoming, Charset.forName(charset)), delimiter.charAt(0), quote.charAt(0), escape.charAt(0), linesToSkip,
171172173174175176177178179
private boolean advance() { try { next = reader.readNext(); } catch (IOException ex) { throw new DatasetReaderException("Could not read record", ex); } return (next != null); }
187188189190191192193194195196
logger.debug("Closing reader on path:{}", path); try { reader.close(); } catch (IOException e) { throw new DatasetReaderException("Unable to close reader path:" + path, e); } state = ReaderWriterState.CLOSED; }
326327328329330331332333334335336
} } return null; default: // FIXED, BYTES, MAP, ARRAY, RECORD are not supported throw new DatasetReaderException( "Unsupported field type:" + schema.getType()); } } catch (NumberFormatException ex) { return null; }
64656667686970717273
logger.debug("Opening reader on path:{}", path); try { reader = new AvroParquetReader<E>(fileSystem.makeQualified(path)); } catch (IOException e) { throw new DatasetReaderException("Unable to create reader path:" + path, e); } state = ReaderWriterState.OPEN; }
80818283848586878889
try { next = reader.read(); } catch (EOFException e) { return false; } catch (IOException e) { throw new DatasetReaderException("Unable to read next record from: " + path, e); } } return next != null; }
107108109110111112113114115116
65666768697071727374
try { reader = new DataFileReader<E>(new AvroFSInput(fileSystem.open(path), fileSystem.getFileStatus(path).getLen()), new ReflectDatumReader<E>( schema)); } catch (IOException e) { throw new DatasetReaderException("Unable to create reader path:" + path, e); } state = ReaderWriterState.OPEN; }
979899100101102103104105106