StarRocks / starrocks

The world's fastest open query engine for sub-second analytics both on and off the data lakehouse. With the flexibility to support nearly any scenario, StarRocks provides best-in-class performance for multi-dimensional analytics, real-time analytics, and ad-hoc queries. A Linux Foundation project.
https://starrocks.io
Apache License 2.0
8.99k stars 1.81k forks source link

[inverted index] 'where DDD match 'uekbysbeodlbfsyfavzc' group by' DDD has error #44315

Closed chengqianli-git closed 5 months ago

chengqianli-git commented 7 months ago

Steps to reproduce the behavior (Required)

  1. CREATE TABLE '...'
    
    CREATE TABLE duplicate_table_demo_datatype_not_replicated_all_varchar ( AAA DATETIME not NULL COMMENT "", BBB VARCHAR(200) not NULL COMMENT "", CCC VARCHAR(200) not NULL COMMENT "", DDD VARCHAR(20000) COMMENT "", EEE LARGEINT  NULL COMMENT "", FFF DECIMAL(20,10) NULL COMMENT "", GGG VARCHAR(200)  NULL COMMENT "", HHH FLOAT  NULL COMMENT "", III BOOLEAN  NULL COMMENT "", KKK CHAR(20)   NULL COMMENT "", LLL STRING   NULL COMMENT "", MMM VARCHAR(20)   NULL COMMENT "", NNN BINARY  NULL COMMENT "", OOO TINYINT NULL COMMENT "", PPP DATETIME NULL COMMENT "", QQQ ARRAY<INT> NULL COMMENT "", RRR JSON NULL COMMENT "", SSS MAP<INT,INT> NULL COMMENT "", TTT STRUCT<a INT, b INT> NULL COMMENT "", INDEX init_bitmap_index (KKK) USING BITMAP ) duplicate KEY(AAA, BBB, CCC) PARTITION BY RANGE (`AAA`) ( START ("1970-01-01") END ("2030-01-01") EVERY (INTERVAL 30 YEAR) ) DISTRIBUTED BY HASH(`AAA`, `BBB`) BUCKETS 3 ORDER BY(`AAA`,`BBB`,`CCC`,`DDD`) PROPERTIES ( "replicated_storage"="false", "replication_num" = "3", "storage_format" = "v2", "enable_persistent_index" = "true", "bloom_filter_columns" = "MMM", "unique_constraints" = "GGG" );

CREATE INDEX idx ON duplicate_table_demo_datatype_not_replicated_all_varchar(DDD) USING GIN('parser' = 'english');

insert into test_inverted_index308c4756_fd35_11ee_a46b_00163e21975a.duplicate_table_demo_datatype_not_replicated_all_varchar values ('2012-05-24 02:38:32', 'oIGCskIxxlAcFOvsGtvL', 'pCcpYkLxqdMXepqCsnJg', 'nnnkpelplvqwgbplqlbz', 5094, -67557.32753, 'BxoopzaKjBkmYJBmaflB', 1.75626917135252, False, 'MpNmyoeewDUShNflvsoz', 'JkWThfHaoBgKkYqPPxQn', 'LCSQNhAxkgxaKqwaPKLS', '', 0, '2015-08-21 06:23:58', [365, 8685, 12025], '{"job": "Buyer, retail", "company": "Li PLC", "ssn": "469-29-6164", "residence": "23440 Oconnor Skyway Apt. 325\nSmithside, PR 21924", "current_location": ["30.6345195", "94.795664"], "blood_group": "A+", "website": ["http://www.mullins-fisher.net/", "http://green.biz/"], "username": "kelli33", "name": "Krista Jordan", "sex": "F", "address": "804 Jenkins Fall Suite 709\nSouth Deborah, FM 13686", "mail": "hfranklin@yahoo.com", "birthdate": "1934-05-01"}', null, null);

mysql> select sum(CCC) from duplicate_table_demo_datatype_not_replicated_all_varchar where DDD match 'uekbysbeodlbfsyfavzc' group by DDD; ERROR 1064 (HY000): Invalid plan: PhysicalOlapScanOperator {table=12471, selectedPartitionId=[12469, 12470], outputColumns=[3: CCC, 21: DDD], projection=null, predicate=4: DDD MATCH uekbysbeodlbfsyfavzc, prunedPartitionPredicates=[], limit=-1} Input dependency cols check failed. The required cols {4} cannot obtain from input cols {3,21}.


### Expected behavior (Required)
success
### Real behavior (Required)
error

### StarRocks version (Required)
 - You can get the StarRocks version by executing SQL `select current_version()`
main-f493d17
srlch commented 6 months ago

https://github.com/StarRocks/starrocks/pull/44514