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

[Bug] Analyze failed Unexpected exception: Index: 8, Size: 7 #11799

Open morningman opened 2 years ago

morningman commented 2 years ago

Search before asking

Version

master

What's Wrong?

Analyze fail with error:

ERROR 1105 (HY000): errCode = 2, detailMessage = Unexpected exception: Index: 8, Size: 7

What You Expected?

No error

How to Reproduce?

CREATE TABLE `baseall` (
  `k0` boolean NULL,
  `k1` tinyint(4) NULL,
  `k2` smallint(6) NULL,
  `k3` int(11) NULL,
  `k4` bigint(20) NULL,
  `k5` decimal(9, 3) NULL,
  `k6` char(5) NULL,
  `k10` date NULL,
  `k11` datetime NULL,
  `k7` varchar(20) NULL,
  `k8` double MAX NULL,
  `k9` float SUM NULL,
  `k12` text REPLACE NULL,
  `k13` largeint(40) REPLACE NULL
) ENGINE=OLAP
AGGREGATE KEY(`k0`, `k1`, `k2`, `k3`, `k4`, `k5`, `k6`, `k10`, `k11`, `k7`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`k1`) BUCKETS 5
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2"
);

CREATE TABLE `test` (
  `k0` boolean NULL,
  `k1` tinyint(4) NULL,
  `k2` smallint(6) NULL,
  `k3` int(11) NULL,
  `k4` bigint(20) NULL,
  `k5` decimal(9, 3) NULL,
  `k6` char(5) NULL,
  `k10` date NULL,
  `k11` datetime NULL,
  `k7` varchar(20) NULL,
  `k8` double MAX NULL,
  `k9` float SUM NULL,
  `k12` text REPLACE_IF_NOT_NULL NULL,
  `k13` largeint(40) REPLACE NULL
) ENGINE=OLAP
AGGREGATE KEY(`k0`, `k1`, `k2`, `k3`, `k4`, `k5`, `k6`, `k10`, `k11`, `k7`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`k1`) BUCKETS 5
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"in_memory" = "false",
"storage_format" = "V2"
);

select a.k1, a.k2, b.k1 from baseall a join (select * from test where k6 = "false" order by k1 limit 3) b on a.k1 = b.k1 where a.k2 > 0 order by 1;

Anything Else?

No response

Are you willing to submit PR?

Code of Conduct

luozenglin commented 2 years ago

fixed by #11819