lide-reed commented on issue #21436:
URL: https://github.com/apache/doris/issues/21436#issuecomment-1617445265
1.1.5 OK
-----
MySQL [testdb]> CREATE TABLE t (
-> c1 varchar(50) NULL,
-> c2 varchar(20) NULL,
-> c3 varchar(10) NULL,
-> c4 bigint(20) NULL
-> ) ENGINE=OLAP
-> DUPLICATE KEY(`c1`)
-> DISTRIBUTED BY HASH(`c1`) BUCKETS 3;
Query OK, 0 rows affected (0.01 sec)
MySQL [testdb]>
MySQL [testdb]>
MySQL [testdb]> SELECT c3
-> FROM (
-> SELECT c1, c2, c3
-> , if(r_num = 1, c4, 0) AS sales_quantity
-> FROM (
-> SELECT c1
-> , if(c2 IS NULL, '', c2) AS c2
-> , row_number() OVER (PARTITION BY c3, c1 ) AS r_num, c3, c4
-> FROM t
-> ) t1
-> ) tmp;
Empty set (0.01 sec)
MySQL [testdb]> explain SELECT c3 FROM ( SELECT c1, c2, c3 , if(r_num
= 1, c4, 0) AS sales_quantity FROM ( SELECT c1 , if(c2 IS NULL, '',
c2) AS c2 , row_number() OVER (PARTITION BY c3, c1 ) AS r_num, c3, c4
FROM t ) t1 ) tmp;
+------------------------------------------------------------------------------------------------------+
| Explain String
|
+------------------------------------------------------------------------------------------------------+
| PLAN FRAGMENT 0
|
| OUTPUT EXPRS:`c3`
|
| PARTITION: HASH_PARTITIONED: `default_cluster:testdb`.`t`.`c1`
|
|
|
| VRESULT SINK
|
|
|
| 0:VOlapScanNode
|
| TABLE: t(null), PREAGGREGATION: OFF. Reason: No AggregateInfo No
AggregateInfo No AggregateInfo |
| partitions=0/1, tablets=0/0, tabletList=
|
| cardinality=0, avgRowSize=16.0, numNodes=1
|
+------------------------------------------------------------------------------------------------------+
10 rows in set (0.00 sec)
--
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]