Skip to content
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

[REVIEW] Support for IS NOT FALSE condition #1455

Merged

Conversation

Christian8491
Copy link
Contributor

@Christian8491 Christian8491 commented Apr 9, 2021

This PR closes #1446 . This PR also enables booleanTest to use null values.

Some of these changes are related to fix 0.20 dependency conflicts and cuda compiler issues cc @mario21ic @romulo-auccapuclla .

As we know in order to support cuda version 11 (as discussed here rapidsai/rmm#736) we need to update our cuda driver versions (450) as http://docs.nvidia.com/deploy/cuda-compatibility/index.html suggest

Finally it's expected that all the cuda-10.X jobs fails.

@Christian8491
Copy link
Contributor Author

Christian8491 commented Apr 9, 2021

rerun tests

3 similar comments
@Christian8491
Copy link
Contributor Author

rerun tests

@wmalpica
Copy link
Contributor

rerun tests

@Christian8491
Copy link
Contributor Author

rerun tests

@Christian8491 Christian8491 changed the title [WIP] Support for IS NOT FALSE condition [REVIEW] Support for IS NOT FALSE condition Apr 12, 2021
@wmalpica
Copy link
Contributor

@Christian8491 column_A IS NOT FALSE seems to evaluate to just column_A, but, have you checked to make sure that that logic holds true with nulls?

@Christian8491
Copy link
Contributor Author

@williamBlazing I will test using nulls and see what is the behavior.

@Christian8491 Christian8491 changed the title [REVIEW] Support for IS NOT FALSE condition [WIP] Support for IS NOT FALSE condition Apr 12, 2021
@Christian8491
Copy link
Contributor Author

rerun tests

@mario21ic
Copy link
Contributor

rerun tests

2 similar comments
@romulo-auccapuclla
Copy link
Contributor

rerun tests

@mario21ic
Copy link
Contributor

rerun tests

@Christian8491 Christian8491 changed the title [WIP] Support for IS NOT FALSE condition [REVIEW] Support for IS NOT FALSE condition Apr 16, 2021
Copy link
Contributor

@wmalpica wmalpica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also explain in the PR what do the changes to the Calcite side do?

@@ -664,11 +664,17 @@ private:
}
bool left_valid = getColumnValid(row_valids, left_position);

if(oper == operator_type::BLZ_IS_NULL) {
if (oper == operator_type::BLZ_IS_NOT_TRUE) {
left_valid = (left_value == false) ? true : false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic does not look right. Please verify.
Also, if this logic is not correct, how is this passing e2e tests?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same questions about BLZ_IS_NOT_FALSE

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way this code is written, it look like its either true or null, and never false. I think its actually either true or false and never null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next column diagram illustrates the right bool values for left_value and left_valid when the column is boolean.
BOOL_COL | left_value | left_valid
null | False | False
True | True | True
False | False | True
null | False | False
False | False | True
True | True | True

Copy link
Contributor Author

@Christian8491 Christian8491 Apr 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a boolean column, left_value is also boolean.
When the value_i is null or false, then left_value will be False.

The next column diagram illustrates the right bool values for left_value and left_valid when the column is boolean.

BOOL_COL | left_value | left_valid
null     | False      | False
True     | True       | True
False    | False      | True
null     | False      | False
False    | False      | True
True     | True       | True

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, to clarify. This is the logic table as I undestand it, and i think we agree that this is what it should be:

BOOL Col | left_value | left_valid | IS_NOT_TRUE | IS_NOT_FALSE | IS_TRUE
null | N/A | FALSE | TRUE | TRUE | FALSE
TRUE | TRUE | TRUE | FALSE | TRUE | TRUE
FALSE | FALSE | TRUE | TRUE | FALSE | FALSE

This is your code:

if (oper == operator_type::BLZ_IS_NOT_TRUE) {
    left_valid = (left_value == false) ? true : false;
    store_data_in_buffer(static_cast<int64_t>(true), buffer, output_position);

Notice that you are always setting the value to true. And the valid is depending on the left_value.
Instead it should be:

if (oper == operator_type::BLZ_IS_NOT_TRUE) {
     bool val = (left_valid == true && left_value == true) ? false : true;
    left_valid = true;
    store_data_in_buffer(static_cast<int64_t>(val), buffer, output_position);

BLZ_IS_NOT_FALSE also needs to be fixed

@wmalpica wmalpica merged commit 6841471 into BlazingDB:branch-0.20 Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] IS NOT FALSE throws an RunExecuteGraph exception
4 participants