File tree Expand file tree Collapse file tree 5 files changed +11
-11
lines changed
embulk-guess-csv/src/main/java/org/embulk/guess/csv
embulk-parser-csv/src/main/java/org/embulk/parser/csv Expand file tree Collapse file tree 5 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 3232import org .embulk .parser .csv .CsvParserPlugin ;
3333import org .embulk .parser .csv .CsvTokenizer ;
3434import org .embulk .parser .csv .InvalidCsvQuotationException ;
35- import org .embulk .parser .csv .TooFewColumnsException ;
35+ import org .embulk .parser .csv .RecordDoesNotHaveExpectedColumnException ;
3636import org .embulk .spi .Buffer ;
3737import org .embulk .spi .BufferAllocator ;
3838import org .embulk .spi .Exec ;
@@ -319,7 +319,7 @@ private static List<List<String>> splitLines(
319319 } else {
320320 columns .add (column );
321321 }
322- } catch (final TooFewColumnsException ex ) {
322+ } catch (final RecordDoesNotHaveExpectedColumnException ex ) {
323323 rows .add (Collections .unmodifiableList (columns ));
324324 break ;
325325 }
Original file line number Diff line number Diff line change @@ -431,7 +431,7 @@ private String nextColumn() {
431431
432432 try {
433433 hasNextRecord = tokenizer .nextRecord ();
434- } catch (TooManyColumnsException ex ) {
434+ } catch (final RecordHasUnexpectedTrailingColumnException ex ) {
435435 if (allowExtraColumns ) {
436436 String tooManyColumnsLine = tokenizer .skipCurrentLine ();
437437 // TODO warning
Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ public boolean nextRecord() {
221221 public boolean nextRecord (final boolean skipEmptyLine ) {
222222 // If at the end of record, read the next line and initialize the state
223223 if (this .recordState != RecordState .END ) {
224- throw new TooManyColumnsException ( "Too many columns" );
224+ throw new RecordHasUnexpectedTrailingColumnException ( );
225225 }
226226
227227 final boolean hasNext = this .nextLine (skipEmptyLine );
@@ -260,7 +260,7 @@ public boolean hasNextColumn() {
260260
261261 public String nextColumn () {
262262 if (!this .hasNextColumn ()) {
263- throw new TooFewColumnsException ( "Too few columns" );
263+ throw new RecordDoesNotHaveExpectedColumnException ( );
264264 }
265265
266266 // reset last state
Original file line number Diff line number Diff line change 1616
1717package org .embulk .parser .csv ;
1818
19- public class TooFewColumnsException extends InvalidCsvFormatException {
20- public TooFewColumnsException ( final String message ) {
21- super (message );
19+ public class RecordDoesNotHaveExpectedColumnException extends InvalidCsvFormatException {
20+ public RecordDoesNotHaveExpectedColumnException ( ) {
21+ super ("A record does not have an expected column (i.e. too few columns)." );
2222 }
2323}
Original file line number Diff line number Diff line change 1616
1717package org .embulk .parser .csv ;
1818
19- public class TooManyColumnsException extends InvalidCsvFormatException {
20- public TooManyColumnsException ( final String message ) {
21- super (message );
19+ public class RecordHasUnexpectedTrailingColumnException extends InvalidCsvFormatException {
20+ public RecordHasUnexpectedTrailingColumnException ( ) {
21+ super ("A record has an unexpected trailing column (i.e. too many columns)." );
2222 }
2323}
You can’t perform that action at this time.
0 commit comments