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

fix(optimizer): handle eval error in LogicalSource::predicate_pushdown #12640

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions e2e_test/source/basic/kafka_batch.slt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,28 @@ select * from s1 where _rw_kafka_timestamp > '1977-01-01 00:00:00+00:00'
3 333
4 4444

query IT rowsort
select * from s1 where _rw_kafka_timestamp > '1977-01-01 00:00:00'
----
1 1
2 22
3 333
4 4444

query IT rowsort
select * from s1 where _rw_kafka_timestamp > TO_TIMESTAMP('1977-01-01 00:00:00.000000', 'YYYY-MM-DD HH24:MI:SS.US')
----
1 1
2 22
3 333
4 4444

statement error expected format
select * from s1 where _rw_kafka_timestamp > 'abc'

statement error out of range
select * from s1 where _rw_kafka_timestamp < TO_TIMESTAMP(2147483647 + 1)

query IT
select * from s1 where _rw_kafka_timestamp > '2045-01-01 0:00:00+00:00'
----
Expand Down
3 changes: 1 addition & 2 deletions src/frontend/src/optimizer/plan_node/logical_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,7 @@ fn expr_to_kafka_timestamp_range(

match &expr {
ExprImpl::FunctionCall(function_call) => {
if let Some((timestampz_literal, reverse)) = extract_timestampz_literal(&expr).unwrap()
{
if let Ok(Some((timestampz_literal, reverse))) = extract_timestampz_literal(&expr) {
match function_call.func_type() {
ExprType::GreaterThan => {
if reverse {
Expand Down
Loading