apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
12.3k stars 3.21k forks source link

Unknown expr node type: 0 #3870

Open sduzh opened 4 years ago

sduzh commented 4 years ago

Describe the bug Run query failed with error message ERROR 1064 (HY000): errCode = 2, detailMessage = Unknown expr node type: 0

To Reproduce

CREATE TABLE `t0` (
  `c0` int(11) NULL COMMENT ""
) ENGINE=OLAP
DUPLICATE KEY(`c0`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`c0`) BUCKETS 1
PROPERTIES (
"replication_num" = "1",
"in_memory" = "false",
"storage_format" = "DEFAULT"
);

SELECT t0.c0 FROM t0 GROUP BY t0.c0  HAVING MIN(((634403704)>=(MOD((('k')LIKE('1')), ACOS(((2050915657)<=(1))))))) < 10;

Expected behavior

Empty set (0.00 sec)

Real behavior

ERROR 1064 (HY000): errCode = 2, detailMessage = Unknown expr node type: 0
sduzh commented 4 years ago

The EXPLAIN statement is OK:

mysql> explain SELECT t0.c0 FROM t0 GROUP BY t0.c0  HAVING MIN(((634403704)>=(MOD((('k')LIKE('1')), ACOS(((2050915657)<=(1))))))) < 10;
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Explain String                                                                                                                                                                                                                        |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| PLAN FRAGMENT 0                                                                                                                                                                                                                       |
|  OUTPUT EXPRS: `t0`.`c0`                                                                                                                                                                                                              |
|   PARTITION: RANDOM                                                                                                                                                                                                                   |
|                                                                                                                                                                                                                                       |
|   RESULT SINK                                                                                                                                                                                                                         |
|                                                                                                                                                                                                                                       |
|   1:AGGREGATE (update finalize)                                                                                                                                                                                                       |
|   |  group by: `t0`.`c0`                                                                                                                                                                                                              |
|   |  tuple ids: 1                                                                                                                                                                                                                     |
|   |                                                                                                                                                                                                                                   |
|   0:OlapScanNode                                                                                                                                                                                                                      |
|      TABLE: t0                                                                                                                                                                                                                        |
|      PREAGGREGATION: OFF. Reason: aggExpr.getChild(0)[( (FunctionCallExpr{name=mod, isStar=false, isDistinct=false, ((( )) (FunctionCallExpr{name=acos, isStar=false, isDistinct=false, ()}))}))] is not SlotRef or CastExpr|CaseExpr |
|      PREDICATES: min((6.34403704E8 >= (mod((('k') LIKE ('1')), acos(0.0))))) < 10                                                                                                                                                     |
|      partitions=0/1                                                                                                                                                                                                                   |
|      rollup: null                                                                                                                                                                                                                     |
|      tabletRatio=0/0                                                                                                                                                                                                                  |
|      tabletList=                                                                                                                                                                                                                      |
|      cardinality=0                                                                                                                                                                                                                    |
|      avgRowSize=0.0                                                                                                                                                                                                                   |
|      numNodes=1                                                                                                                                                                                                                       |
|      tuple ids: 0                                                                                                                                                                                                                     |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
22 rows in set (0.01 sec)