Skip to content

Commit

Permalink
fix(optimizer): handle eval error in `LogicalSource::predicate_pushdo…
Browse files Browse the repository at this point in the history
…wn` (#12640)
  • Loading branch information
xiangjinwu authored Oct 6, 2023
1 parent f26ac7a commit c847095
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
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

0 comments on commit c847095

Please sign in to comment.