Class CsvConnector
java.lang.Object
com.darkcollective.relix.connectors.std.internal.CsvConnector
- All Implemented Interfaces:
RelixConnector,AutoCloseable
Built-in
RelixConnector for local CSV files — the reference
implementation of the connector SPI.
Handles the "csv" type token. Configuration keys:
path— the CSV file path (required; the registry supplies it already resolved against the script's base directory).header—"true"(default) to read the first row as column names for case-insensitive mapping,"false"for positional mapping.
RFC 4180 parsing and per-type coercion are shared with the legacy
CsvDataSourceConnector via CsvDataSourceConnector.readCsv(java.nio.file.Path, boolean, com.darkcollective.relix.symbol.Schema). The
whole file is read eagerly, so the returned stream holds no file handle and
RelixConnector.close() is a no-op.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.darkcollective.relix.processor.connector.RelixConnector
close, openQuery, tableSchema, tableStatistics
-
Constructor Details
-
CsvConnector
public CsvConnector()Public no-arg constructor required forServiceLoaderdiscovery.
-
-
Method Details
-
handles
Description copied from interface:RelixConnectorThe type tokens this connector handles, lower-cased — e.g.{"jdbc"},{"csv"},{"mongodb"}. The registry uses these for dispatch.- Specified by:
handlesin interfaceRelixConnector- Returns:
- a non-empty set of handled type tokens
-
open
Description copied from interface:RelixConnectorOpens a stream of rows for a named table/collection/endpoint. The caller closes the returned stream.- Specified by:
openin interfaceRelixConnector- Parameters:
config- the connector configuration for this relationtable- the table/collection/endpoint name within the sourceschema- the expected output schema (column order and types)- Returns:
- a stream of rows; the caller is responsible for closing it
-