java.lang.Object
com.darkcollective.relix.connectors.std.internal.CsvConnector
All Implemented Interfaces:
RelixConnector, AutoCloseable

public final class CsvConnector extends Object implements RelixConnector
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 Details

    • CsvConnector

      public CsvConnector()
      Public no-arg constructor required for ServiceLoader discovery.
  • Method Details

    • handles

      public Set<String> handles()
      Description copied from interface: RelixConnector
      The type tokens this connector handles, lower-cased — e.g. {"jdbc"}, {"csv"}, {"mongodb"}. The registry uses these for dispatch.
      Specified by:
      handles in interface RelixConnector
      Returns:
      a non-empty set of handled type tokens
    • open

      public Stream<Row> open(ConnectorConfig config, String table, Schema schema)
      Description copied from interface: RelixConnector
      Opens a stream of rows for a named table/collection/endpoint. The caller closes the returned stream.
      Specified by:
      open in interface RelixConnector
      Parameters:
      config - the connector configuration for this relation
      table - the table/collection/endpoint name within the source
      schema - the expected output schema (column order and types)
      Returns:
      a stream of rows; the caller is responsible for closing it