Package dev.frostlake.executor.copy
package dev.frostlake.executor.copy
-
ClassDescriptionExecutes 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 ofQueryExecutor.The category / code / SQLSTATE triple aVALIDATION_MODE = RETURN_ERRORSrow carries for one rejected record, live-verified per family: a value that would not convert isconversion / 100038 / 22018; a record whose field count misses the table isparsing / 22000with 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 isother / 100112 / 22000.The FIRST record one staged file rejected, asCOPY INTO <table>reports it in the trailing four columns of its per-file result —first_error,first_error_line,first_error_characterandfirst_error_column_name.A staged CSV record whose field count does not match the target table's column count, rejected byERROR_ON_COLUMN_COUNT_MISMATCH(seeCopyCommandExecutor.requireCsvColumnCountfor 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.gzreads through aGZIPInputStream.Reads a staged file of a record-based FILE_FORMAT (JSON, XML, Avro, Parquet, ORC) into a list ofJsonNoderecords.Selects theStageFileReaderfor a record-based FILE_FORMAT TYPE.XML staged-file reader (JDK DOM — no external dependency).