Skip to content

Commit

Permalink
test: rm unused cast
Browse files Browse the repository at this point in the history
  • Loading branch information
discord9 committed Aug 2, 2024
1 parent d408fdb commit 406bb31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/flow/src/transform/aggr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ mod test {
#[tokio::test]
async fn test_cast_max_min() {
let engine = create_test_query_engine();
let sql = "SELECT CAST((max(number) - min(number)) AS FLOAT)/30.0, date_bin(INTERVAL '30 second', CAST(ts AS TimestampMillisecond)) as time_window from numbers_with_ts GROUP BY time_window";
let sql = "SELECT (max(number) - min(number))/30.0, date_bin(INTERVAL '30 second', CAST(ts AS TimestampMillisecond)) as time_window from numbers_with_ts GROUP BY time_window";
let plan = sql_to_substrait(engine.clone(), sql).await;

let mut ctx = create_test_ctx();
Expand Down Expand Up @@ -1612,7 +1612,6 @@ mod test {
.map(vec![
ScalarExpr::Column(1)
.call_binary(ScalarExpr::Column(2), BinaryFunc::SubUInt32)
.cast(CDT::float32_datatype())
.cast(CDT::float64_datatype())
.call_binary(
ScalarExpr::Literal(Value::from(30.0f64), CDT::float64_datatype()),
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/standalone/common/flow/flow_basic.result
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Affected Rows: 0
CREATE FLOW find_approx_rate
SINK TO approx_rate
AS
SELECT CAST((max(byte) - min(byte)) AS FLOAT)/30.0 as rate, date_bin(INTERVAL '30 second', ts) as time_window from bytes_log GROUP BY time_window;
SELECT (max(byte) - min(byte))/30.0 as rate, date_bin(INTERVAL '30 second', ts) as time_window from bytes_log GROUP BY time_window;

Affected Rows: 0

Expand Down
2 changes: 1 addition & 1 deletion tests/cases/standalone/common/flow/flow_basic.sql
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ CREATE TABLE approx_rate (
CREATE FLOW find_approx_rate
SINK TO approx_rate
AS
SELECT CAST((max(byte) - min(byte)) AS FLOAT)/30.0 as rate, date_bin(INTERVAL '30 second', ts) as time_window from bytes_log GROUP BY time_window;
SELECT (max(byte) - min(byte))/30.0 as rate, date_bin(INTERVAL '30 second', ts) as time_window from bytes_log GROUP BY time_window;

INSERT INTO bytes_log VALUES
(101, '2025-01-01 00:00:01'),
Expand Down

0 comments on commit 406bb31

Please sign in to comment.