TypeInferrer

io.github.quafadas.table.TypeInferrer

Enumeration of strategies for inferring column types when reading CSV files.

  • FirstRow: Infers types by inspecting only the first row of data.
  • FirstN: Infers types by inspecting the first n rows. Optionally, prefers Int over Boolean if both are possible.
  • FromAllRows: Infers types by inspecting all rows in the CSV.
  • StringType: Disables type inference; all columns are read as String.
  • FromTuple[T]: Uses a user-supplied tuple type T for decoding, allowing custom or manual type specification.

Attributes

Graph
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Type members

Enum entries

final case class FirstN(n: Int, preferIntToBoolean: Boolean)

Infers column types by inspecting the first n rows.

Infers column types by inspecting the first n rows.

Value parameters

n

Number of rows to inspect for type inference.

preferIntToBoolean

If true, prefers Int over Boolean when both are possible.

Attributes

case FirstRow extends TypeInferrer

Infers column types by inspecting only the first row of data. Fast, but may be inaccurate if the first row is not representative.

Infers column types by inspecting only the first row of data. Fast, but may be inaccurate if the first row is not representative.

Attributes

case FromAllRows extends TypeInferrer

Infers column types by inspecting all rows in the CSV. Most accurate, but may be slower for large files.

Infers column types by inspecting all rows in the CSV. Most accurate, but may be slower for large files.

Attributes

final case class FromTuple[T]()

Uses a user-supplied tuple type T for decoding. Allows for custom or manual type specification, including custom decoders.

Uses a user-supplied tuple type T for decoding. Allows for custom or manual type specification, including custom decoders.

Type parameters

T

The tuple type to use for decoding each row.

Attributes

case StringType extends TypeInferrer

Disables type inference; all columns are read as String. Use for maximum safety or when schema is unknown.

Disables type inference; all columns are read as String. Use for maximum safety or when schema is unknown.

Attributes