-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix make_array
null handling, update tests
#6900
Conversation
if arr.is_valid(index) { | ||
builder.values().append_value(arr.value(index)); | ||
} else { | ||
builder.values().append_null(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are the only actual code change; The rest of this PR is doc comments and tests
(6, 11, NULL, 7.7, 'consectetur'), | ||
(7, 13, 14, NULL, 'adipiscing'), | ||
(8, 15, 16, 8.8, NULL) | ||
(1, 1, 2, 1.1, 'Lorem', 'A'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adds a new column, e
and whitespace OCD
# make_array with columns #2 | ||
# make_array with 1 columns | ||
query ??? | ||
select make_array(a), make_array(d), make_array(e) from values; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I broke out the tests for make_array
with a single column from the tests of make_array
with 2 column
cc @izveigor |
/// │ │ [C, Z] │ │ │ │ NULL │ │ │ │ [C, Z, NULL] │ │ | ||
/// │ └──────────┘ │ │ └──────────┘ │ │ └────────────────────┘ │ | ||
/// └──────────────┘ └──────────────┘ └────────────────────────┘ | ||
/// col1 col2 output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are good comments 👍
I think we can make a custom template for all array functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Which issue does this PR close?
Closes #6887
Rationale for this change
Fix a bug (see #6887)
What changes are included in this PR?
NOTE this PR looks large, but has only 4 lines of code changes. The rest of it is doc comments and tests
null
when creating new arraysAre these changes tested?
yes
Are there any user-facing changes?
fix regression