seawinde opened a new pull request, #36111:
URL: https://github.com/apache/doris/pull/36111
## Proposed changes
Support to use current_date() when create async materialized view by adding
`'enable_date_nondeterministic_function' = 'true'` in properties when create
materialized view. `enable_date_nondeterministic_function` is default false.
Here is a example, it will success
`
CREATE MATERIALIZED VIEW mv_name
BUILD DEFERRED REFRESH AUTO ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES (
'replication_num' = '1',
'enable_date_nondeterministic_function' = 'true'
)
AS
SELECT *, unix_timestamp(k3, '%Y-%m-%d %H:%i-%s') from ${tableName}
where current_date() > k3;
`
Note:
`unix_timestamp` is nondeterministic when has no params. it is deterministic
when has params which means format column k3 date
another example, it will fail
`
CREATE MATERIALIZED VIEW mv_name
BUILD DEFERRED REFRESH AUTO ON MANUAL
DISTRIBUTED BY RANDOM BUCKETS 2
PROPERTIES (
'replication_num' = '1',
'enable_date_nondeterministic_function' = 'true'
)
AS
SELECT *, unix_timestamp() from ${tableName} where current_date() >
k3;
`
because `unix_timestamp()` is nondeterministic
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]