Repository navigation
fix(processor): null the current row when SET returns a NULL value (fixes #1136) - #1146
Merged
Merged
Conversation
…ixes LadybugDB#1136) writeColumnUpdateResult marked the projected column NULL at the position taken from the evaluated value's selection vector. For a literal NULL that is always position 0, so only the first row of the chunk was nulled and every later row returned its old value. Use the projected column's own position, as the non-NULL branch already does. The paths that null the column for a missing property or an unmatched table had the same mistake.
Contributor
|
The code looks good. Could you update the tests?
|
Contributor
Author
|
Updated the test coverage in est/test_files/dml_node/set/set_read.test and est/test_files/dml_rel/set/set_read_tinysnb.test in commit 9609da1:
|
Contributor
Author
The mixed-label and expression-to-NULL cases were added in 9609da1, but CI found that a relationship test assigned an INT64 expression to a DATE property. The follow-up uses DATE-valued Validation in Ubuntu 24.04 Docker with GCC 13.3.0:
The full suite is left to PR CI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1136.
Problem. When
SET x.prop = NULL ... RETURN x.propupdates more than one row, only the first row of the chunk comes back asNULL. Every other row returns its old value, even though the stored value isNULL:This affects node and rel properties, single and multi-label
SET. Setting a non-NULL value is not affected.Root cause.
writeColumnUpdateResultcopies the new value into the projected column (columnVector) at the column's current position,columnSelVector[0]. The NULL branch instead useddataSelVector[0], the position in the evaluated value's vector. For a literal that vector has its own state, so the position is always 0. On every row of a flattened chunk, it nulled row 0 of the projected column and left the current row alone.The four places that null the projected column when the property does not exist in the table, or when the table is not in the label set, used the same wrong position (
columnDataVector's selection vector). Today the projected value for those rows is alreadyNULLfrom the scan, so I could not produce a visible wrong result through them. They still wrote to the wrong row, though, so they now use the column's own position too.Fix. Use
columnVector's selection position in all fivesetNullcalls, matching the non-NULL branch.Tests.
dml_node/set/set_read.test, new caseSetNullReadMultipleRows: multi-rowSET ... = NULL RETURNforINT64andSTRINGproperties, a follow-up read, and the multi-label path (MATCH (a:organisation:play)).dml_rel/set/set_read_tinysnb.test, new caseSetNullReadMultipleRows: the same for a rel property over three rels.clang-format-18reports no changes forset_executor.cpp. I have not run the e2e suite locally (my local build did not finish), so CI is the first run of these tests.