Package dev.frostlake.executor.copy


package dev.frostlake.executor.copy
  • Class
    Description
    Executes the COPY subsystem — the stage-file load (COPY INTO <table>) and unload (COPY INTO <stage>) paths, VALIDATION_MODE, COPY transformations, and the file/format dispatch — on behalf of QueryExecutor.
    The category / code / SQLSTATE triple a VALIDATION_MODE = RETURN_ERRORS row carries for one rejected record, live-verified per family: a value that would not convert is conversion / 100038 / 22018; a record whose field count misses the table is parsing / 22000 with code 100080 (short or long record) or 100068 (end of record reached mid-column, the blank-line case); a FILES entry the stage does not hold is other / 100112 / 22000.
    The FIRST record one staged file rejected, as COPY INTO <table> reports it in the trailing four columns of its per-file result — first_error, first_error_line, first_error_character and first_error_column_name.
    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).
    JSON staged-file reader: a top-level array yields one record per element, otherwise the file is read as newline-delimited JSON (one record per non-blank line).
    Byte access to staged files with transparent gzip: a name ending .gz reads through a GZIPInputStream.
    Reads a staged file of a record-based FILE_FORMAT (JSON, XML, Avro, Parquet, ORC) into a list of JsonNode records.
    Selects the StageFileReader for a record-based FILE_FORMAT TYPE.
    XML staged-file reader (JDK DOM — no external dependency).