Class CsvColumnCountException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.frostlake.executor.copy.CsvColumnCountException
All Implemented Interfaces:
Serializable

public final class CsvColumnCountException extends RuntimeException
A staged CSV record whose field count does not match the target table's column count, rejected by ERROR_ON_COLUMN_COUNT_MISMATCH (see CopyCommandExecutor.requireCsvColumnCount for the rule and the live evidence behind it).

It carries its own first_error geometry rather than letting the generic CSV error describer work it out: the record is rejected BEFORE a row is ever built, so there is no built row to re-check column by column, and the position the account reports is not the offending field's start — for the two "record ran out" shapes it is the position just PAST the record, which is off the end of the field list entirely.

See Also:
  • Constructor Details

    • CsvColumnCountException

      public CsvColumnCountException(String message, int line, Integer character, String columnName)
  • Method Details

    • getLine

      public int getLine()
      The 1-based PHYSICAL line the account reports — NOT always the offending record's own line. A mismatch on the file's first data record is reported at the position just past that record, which the account renders as the start of the FOLLOWING line when there is one.
    • getCharacter

      public Integer getCharacter()
      The 1-based character offset within the reported line.
    • getColumnName

      public String getColumnName()
      "TABLE"["COLUMN":ordinal], or "TABLE"[ordinal] when no such column exists.