Skip to content

Commit

Permalink
attempt at numerical null fields as default values
Browse files Browse the repository at this point in the history
  • Loading branch information
colindickson committed Aug 7, 2023
1 parent fa82b28 commit e5ff860
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions csvprocessor/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func formatField(f interface{}, t schema.FieldType, isArray, isNullable bool) st
case schema.FieldTypeBigInt:
if f == nil {
if isNullable {
return "NULL"
return "0"
}
return "0"
}
Expand All @@ -263,7 +263,7 @@ func formatField(f interface{}, t schema.FieldType, isArray, isNullable bool) st
case schema.FieldTypeBigDecimal:
if f == nil {
if isNullable {
return "NULL"
return "0"
}
return "0"
}
Expand All @@ -274,7 +274,7 @@ func formatField(f interface{}, t schema.FieldType, isArray, isNullable bool) st
case schema.FieldTypeInt:
if f == nil {
if isNullable {
return "NULL"
return "0"
}
return "0"
}
Expand All @@ -297,7 +297,7 @@ func formatField(f interface{}, t schema.FieldType, isArray, isNullable bool) st
case schema.FieldTypeBoolean:
if f == nil {
if isNullable {
return "NULL"
return "false"
}
return "false"
}
Expand Down

0 comments on commit e5ff860

Please sign in to comment.