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.
68697071727374757677
try { reader = new DataFileReader<E>(new AvroFSInput(fileSystem.open(path), fileSystem.getFileStatus(path).getLen()), DataModelUtil.getDatumReaderForType(type, schema)); } catch (IOException e) { throw new DatasetReaderException("Unable to create reader path:" + path, e); } state = ReaderWriterState.OPEN; }
9091929394959697
E record = DataModelUtil.createRecord(type, schema); try { return reader.next(record); } catch (IOException ex) { throw new DatasetReaderException(ex); } }
105106107108109110111112113114
LOG.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; }
72737475767778798081
try { reader = new AvroParquetReader<E>( fileSystem.getConf(), fileSystem.makeQualified(path)); } catch (IOException e) { throw new DatasetReaderException("Unable to create reader path:" + path, e); } state = ReaderWriterState.OPEN; }
88899091929394959697
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; }
115116117118119120121122123124
142143144145146147148149150
case UNION: int index = ReflectData.get().resolveUnion(schema, value); return valueString(value, schema.getTypes().get(index)); default: // FIXED, BYTES, MAP, ARRAY, RECORD are not supported throw new DatasetReaderException( "Unsupported field type:" + schema.getType()); } }
8687888990919293949596
try { this.incoming = fs.open(path); this.size = fs.getFileStatus(path).getLen(); } catch (IOException ex) { throw new DatasetReaderException("Cannot open path: " + path, ex); } this.reader = CSVUtil.newReader(incoming, props); // header is determined by the schema, so skip the file header // TODO: support the orderByHeader property
130131132133134135136137138
private boolean advance() { try { next = reader.readNext(); } catch (IOException ex) { throw new DatasetReaderException("Could not read record", ex); } return (next != null); }
146147148149150151152153154155