DefaultDatasetImporter

class DefaultDatasetImporter(credentialResolver: CredentialResolver = DefaultCredentialResolver) : DatasetImporter(source)

Default importer: dispatches on the reference variant and the (layout, delimiter) pair, delegating to existing KSL IO helpers.

Mapping:

  • Inline -> wrap entries as NamedDataset, preserving Map order

  • DelimitedFile + SINGLE + WS -> KSLFileUtil.scanToArray; dataset name = file stem

  • DelimitedFile + WIDE + COMMA -> CSVUtil.readToColumns; one dataset per column, optionally filtered to datasetColumns (in filter order)

  • DelimitedFile + LONG + COMMA -> CSVUtil.readRowsToListOfStringArrays + WideLongReshape.splitLong

  • Generated -> sample a KSL random variable (RVType + parameters)

  • Database -> DatabaseDataReader (table/query -> DataFrame -> datasets)

credentialResolver resolves database credentials at run time for server connections; it defaults to DefaultCredentialResolver (env vars / TOML secrets file). A front-end that needs to prompt for credentials constructs this importer with its own resolver and passes it to the session.

Constructors

Link copied to clipboard
constructor(credentialResolver: CredentialResolver = DefaultCredentialResolver)

Functions

Link copied to clipboard
open override fun import(reference: DataSourceReference): List<NamedDataset>

Resolves the reference and returns one or more non-empty datasets. Throws ImportException when the reference is unresolvable or any dataset would be empty.