Skip to content

Commit 9ea070e

Browse files
authored
Merge pull request #7686 from b41sh/fix-cast-deterministic
fix(query): fix cast deterministic error
2 parents 596e2d6 + 67761e6 commit 9ea070e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/query/service/src/sql/planner/plans/scalar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ impl ScalarExpr for CastExpr {
511511
}
512512

513513
fn is_deterministic(&self) -> bool {
514-
true
514+
self.argument.is_deterministic()
515515
}
516516
}
517517

tests/logictest/suites/base/02_function/02_0002_function_cast

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,3 +524,10 @@ SELECT parse_json('[1,2,3]')::object;
524524
statement error 1010
525525
SELECT parse_json('null')::object;
526526

527+
528+
statement query I
529+
SELECT count(distinct a) FROM (SELECT rand()::string AS a FROM numbers(10));
530+
531+
----
532+
10
533+

0 commit comments

Comments
 (0)