Skip to content

Commit

Permalink
Don't instantiate input format by default, create it in options funct…
Browse files Browse the repository at this point in the history
…ion if nil
  • Loading branch information
tomasz-h2o committed Jan 22, 2024
1 parent 2a94357 commit 0095e4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion task_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func defaultTaskIngestionSpec() *TaskIngestionSpec {
IOConfig: &IOConfig{
Type: "index_parallel",
InputSource: &InputSource{},
InputFormat: &InputFormat{},
// InputFormat: &InputFormat{},
},
TuningConfig: &TuningConfig{
Type: "index_parallel",
Expand Down Expand Up @@ -176,6 +176,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 0095e4d

Please sign in to comment.