Search before asking
Version
2.0 2.1
What's Wrong?
I have query like this:
WITH x AS (
SELECT
a.tz_name,
a.ddate
FROM
dim_time_zone_range a
)
select
*
from
(
select
tz_name,
ddate
from
x
UNION ALL
select
'99999' AS tz_name,
ddate
from
x
) tmp
where
tmp.ddate = '2024-04-30'
AND tmp.tz_name = '东八区'
when I delete “tmp.tz_name = '东八区'” condition,doris nereids plan like this:

when I add this condition,ddate field condition don't push down on longer:

in the other way, two condition can push down if delete UNION ALL 👍

What You Expected?
ddate field condition can push down when this query has union all statment
How to Reproduce?
DDL:
CREATE TABLE dim_time_zone_range (
ddate date NULL,
id bigint(20) NULL,
time_zone varchar(65533) NULL,
zone_offset varchar(65533) NULL,
tz_name varchar(65533) NULL,
start_time datetime NULL,
end_time datetime NULL
) ENGINE=OLAP
UNIQUE KEY(ddate, id)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(ddate) BUCKETS 16
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"is_being_synced" = "false",
"storage_format" = "V2",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false"
);
insert into dim_time_zone_range values('2024-04-30',123,'UTC-8','+8','东八区','2024-04-30',2024-04-30);
query:
WITH x AS (
SELECT
a.tz_name,
a.ddate
FROM
dim_time_zone_range a
)
select
*
from
(
select
tz_name,
ddate
from
x
UNION ALL
select
'99999' AS tz_name,
ddate
from
x
) tmp
where
tmp.ddate = '2024-04-30'
AND tmp.tz_name = '东八区'
Anything Else?
No response
Are you willing to submit PR?
Code of Conduct
Search before asking
Version
2.0 2.1
What's Wrong?
I have query like this:
WITH x AS (
SELECT
a.tz_name,
a.ddate
FROM
dim_time_zone_range a
)
select
*
from
(
select
tz_name,ddate
from
x
UNION ALL
select
'99999' AS
tz_name,ddate
from
x
) tmp
where
tmp.ddate = '2024-04-30'
AND tmp.tz_name = '东八区'
when I delete “tmp.tz_name = '东八区'” condition,doris nereids plan like this:


when I add this condition,ddate field condition don't push down on longer:
in the other way, two condition can push down if delete UNION ALL 👍

What You Expected?
ddate field condition can push down when this query has union all statment
How to Reproduce?
DDL:
CREATE TABLE
dim_time_zone_range(ddatedate NULL,idbigint(20) NULL,time_zonevarchar(65533) NULL,zone_offsetvarchar(65533) NULL,tz_namevarchar(65533) NULL,start_timedatetime NULL,end_timedatetime NULL) ENGINE=OLAP
UNIQUE KEY(
ddate,id)COMMENT 'OLAP'
DISTRIBUTED BY HASH(
ddate) BUCKETS 16PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"is_being_synced" = "false",
"storage_format" = "V2",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false"
);
insert into dim_time_zone_range values('2024-04-30',123,'UTC-8','+8','东八区','2024-04-30',2024-04-30);
query:
WITH x AS (
SELECT
a.tz_name,
a.ddate
FROM
dim_time_zone_range a
)
select
*
from
(
select
tz_name,ddate
from
x
UNION ALL
select
'99999' AS
tz_name,ddate
from
x
) tmp
where
tmp.ddate = '2024-04-30'
AND tmp.tz_name = '东八区'
Anything Else?
No response
Are you willing to submit PR?
Code of Conduct