Skip to content

Commit

Permalink
fix: to filldefault value when nullable and default value are enable …
Browse files Browse the repository at this point in the history
…both

Signed-off-by: lixinguo <[email protected]>
  • Loading branch information
lixinguo committed Sep 6, 2024
1 parent 11325d9 commit bb5304b
Show file tree
Hide file tree
Showing 2 changed files with 350 additions and 11 deletions.
32 changes: 21 additions & 11 deletions internal/proxy/validate_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ func (v *validateUtil) fillWithDefaultValue(field *schemapb.FieldData, fieldSche
return err
}

if !fieldSchema.GetNullable() {
if fieldSchema.GetNullable() {
field.ValidData = make([]bool, numRows)
} else {
field.ValidData = []bool{}
}

Expand All @@ -406,7 +408,9 @@ func (v *validateUtil) fillWithDefaultValue(field *schemapb.FieldData, fieldSche
return err
}

if !fieldSchema.GetNullable() {
if fieldSchema.GetNullable() {
field.ValidData = make([]bool, numRows)
} else {
field.ValidData = []bool{}
}

Expand All @@ -420,7 +424,9 @@ func (v *validateUtil) fillWithDefaultValue(field *schemapb.FieldData, fieldSche
if err != nil {
return err
}
if !fieldSchema.GetNullable() {
if fieldSchema.GetNullable() {
field.ValidData = make([]bool, numRows)
} else {
field.ValidData = []bool{}
}

Expand All @@ -434,8 +440,9 @@ func (v *validateUtil) fillWithDefaultValue(field *schemapb.FieldData, fieldSche
if err != nil {
return err
}

if !fieldSchema.GetNullable() {
if fieldSchema.GetNullable() {
field.ValidData = make([]bool, numRows)
} else {
field.ValidData = []bool{}
}

Expand All @@ -449,8 +456,9 @@ func (v *validateUtil) fillWithDefaultValue(field *schemapb.FieldData, fieldSche
if err != nil {
return err
}

if !fieldSchema.GetNullable() {
if fieldSchema.GetNullable() {
field.ValidData = make([]bool, numRows)
} else {
field.ValidData = []bool{}
}

Expand All @@ -464,8 +472,9 @@ func (v *validateUtil) fillWithDefaultValue(field *schemapb.FieldData, fieldSche
if err != nil {
return err
}

if !fieldSchema.GetNullable() {
if fieldSchema.GetNullable() {
field.ValidData = make([]bool, numRows)
} else {
field.ValidData = []bool{}
}

Expand All @@ -484,8 +493,9 @@ func (v *validateUtil) fillWithDefaultValue(field *schemapb.FieldData, fieldSche
if err != nil {
return err
}

if !fieldSchema.GetNullable() {
if fieldSchema.GetNullable() {
field.ValidData = make([]bool, numRows)
} else {
field.ValidData = []bool{}
}

Expand Down
Loading

0 comments on commit bb5304b

Please sign in to comment.