Documentation ¶
Index ¶
- type Config
- type ConfigFunc
- func Delimiter(delimiter byte) ConfigFunc
- func EmptyNull(emptyNull bool) ConfigFunc
- func EnumValues(values map[string][]string) ConfigFunc
- func Headers(headers []string) ConfigFunc
- func IgnoreEmptyLines(ignoreEmptyLines bool) ConfigFunc
- func RowCountHint(rowCount int) ConfigFunc
- func Types(typs map[string]string) ConfigFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config holds configuration for reading CSV files into QFrames. It should be considered a private implementation detail and should never be referenced or used directly outside of the QFrame code. To manipulate it use the functions returning ConfigFunc below.
func NewConfig ¶
func NewConfig(ff []ConfigFunc) Config
NewConfig creates a new Config object. This function should never be called from outside QFrame.
type ConfigFunc ¶
type ConfigFunc func(*Config)
ConfigFunc is a function that operates on a Config object.
func Delimiter ¶
func Delimiter(delimiter byte) ConfigFunc
Delimiter configures the delimiter/separator between columns. Only byte representable delimiters are supported. Default is ','.
delimiter - The delimiter to use.
func EmptyNull ¶
func EmptyNull(emptyNull bool) ConfigFunc
EmptyNull configures if empty strings should be considered as empty strings (default) or null.
emptyNull - If set to true empty string will be translated to null.
func EnumValues ¶
func EnumValues(values map[string][]string) ConfigFunc
EnumValues is used to list the possible values and internal order of these values for an enum column.
values - map column name -> list of valid values.
Enum columns that do not specify the values are automatically assigned values based on the content of the column. The ordering between these values is undefined. It hence doesn't make much sense to sort a QFrame on an enum column unless the ordering has been specified.
Note that the column must be listed as having an enum type (using Types above) for this option to take effect.
func Headers ¶ added in v0.3.2
func Headers(headers []string) ConfigFunc
Headers can be used to specify the header names for a CSV file without header.
header - Slice with column names.
func IgnoreEmptyLines ¶
func IgnoreEmptyLines(ignoreEmptyLines bool) ConfigFunc
IgnoreEmptyLines configures if a line without any characters should be ignored or interpreted as a zero length string.
ignoreEmptyLines - If set to true empty lines will not produce any data.
func RowCountHint ¶
func RowCountHint(rowCount int) ConfigFunc
RowCountHint can be used to provide an indication of the number of rows in the CSV. In some cases this will help allocating buffers more efficiently and improve import times.
rowCount - The number of rows.
func Types ¶
func Types(typs map[string]string) ConfigFunc
Types is used set types for certain columns. If types are not given a best effort attempt will be done to auto detected the type.
typs - map column name -> type name. For a list of type names see package qframe/types.