Support nullable base types for (*Build[T]) #638
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before, we had
null
tag that set schema column to nullable. However the base types allowed wereint64|float64|bool|string
.This begged the question, what is
null
? for anullable
field of typeint64
do we interpret0
asnull
?, probably not. We were offering option for something that was impossible to represent.Fortunately, we can safely represent null values with out type system. For
base types
*int64|*float64|*bool|*string
defines nullable base types.This commit add support for both
int64|float64|bool|string
and*int64|*float64|*bool|*string
for base types . This works with dynamic columns too.With this change
null
tag is redundant so It was removed. Fields of type*int64|*float64|*bool|*string
will automatically generate nullable schemacolumn.
NOTE: I also discovered a bug where when
T
has dynamic column and you append multipleT
without any dynamic column followed by T with dynamic column caused a panic. The issue was how we adjusted dynamic columns to match current.Append
rows state. The fix is included in this commit because I needed this behavior in tests.