-
Notifications
You must be signed in to change notification settings - Fork 323
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
Implement in-memory and database mixed decimal column comparisons #10614
Conversation
This still has only failing test but mostly it is ready for review. |
group_builder.specify "(Column_Operations_Spec) should allow to compare numbers (including mixed types)" <| | ||
x_values = [1.25, 4.5, 5.0] | ||
y_values = [2.0, 3.0, 5.0] | ||
|
||
converters = [.truncate, x->x, dec] | ||
converters.map x_converter-> converters.map y_converter-> | ||
x_values_converted = x_values.map x_converter | ||
y_values_converted = y_values.map y_converter | ||
with_mixed_columns_if_supported [['x', x_values_converted + [Nothing]], ['y', y_values_converted + [Nothing]]] t-> | ||
x = t.at "x" | ||
y = t.at "y" | ||
|
||
Test.with_clue " comparison: "+x.value_type.to_text+', '+y.value_type.to_text+" " <| | ||
(x < y).to_vector . should_equal [True, False, False, Nothing] | ||
(x <= y).to_vector . should_equal [True, False, True, Nothing] | ||
(x > y).to_vector . should_equal (x <= y).not.to_vector | ||
(x >= y).to_vector . should_equal (x < y).not.to_vector | ||
|
||
converters.map converter-> | ||
const_float = 3.0 | ||
constant = converter const_float | ||
Test.with_clue " constant: "+(Meta.get_simple_type_name constant) <| | ||
(x == constant).to_vector . should_equal [False, False, False, Nothing] | ||
(x != constant).to_vector . should_equal [True, True, True, Nothing] | ||
(y == constant).to_vector . should_equal [False, True, False, Nothing] | ||
(y != constant).to_vector . should_equal [True, False, True, Nothing] |
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.
This is a lot of nesting. What is the runtime of this test for in-memory/Postgres?
I think it should be disabled for Snowflake as I imagine it will be super slow there.
Could you make it pending if run_advanced_edge_case_tests
is false?
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.
Done.
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.
Looks good, but now that we know how much slower tests like Snowflake are, please let's ensure that such thorough tests are hidden behind run_advanced_edge_case_tests
flag. Apart from in-memory, they are testing the underlying DB implementation that we do not control anyway.
Also implement more comprehensive mixed comparison tests.
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.