Skip to content

Commit

Permalink
Merge pull request #18 from h2oai/tomasz/input-format-defaults
Browse files Browse the repository at this point in the history
Input format default
  • Loading branch information
tomasz-h2o authored Jan 22, 2024
2 parents 2a94357 + 0c82ee4 commit c19c9dc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion task_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func defaultTaskIngestionSpec() *TaskIngestionSpec {
IOConfig: &IOConfig{
Type: "index_parallel",
InputSource: &InputSource{},
InputFormat: &InputFormat{},
},
TuningConfig: &TuningConfig{
Type: "index_parallel",
Expand Down Expand Up @@ -176,6 +175,10 @@ func SetTaskIOConfigType(typ string) TaskIngestionSpecOptions {
// SetTaskInputFormat configures input format for the task based ingestion.
func SetTaskInputFormat(typ string, findColumnsHeader string, columns []string) TaskIngestionSpecOptions {
return func(spec *TaskIngestionSpec) {
if spec.Spec.IOConfig.InputFormat == nil {
spec.Spec.IOConfig.InputFormat = &InputFormat{}
}

spec.Spec.IOConfig.InputFormat.Type = typ
spec.Spec.IOConfig.InputFormat.FindColumnsFromHeader = findColumnsHeader
spec.Spec.IOConfig.InputFormat.Columns = columns
Expand Down

0 comments on commit c19c9dc

Please sign in to comment.