manticoresoftware / manticoresearch

Easy to use open source fast database for search | Good alternative to Elasticsearch now | Drop-in replacement for E in the ELK soon
https://manticoresearch.com
GNU General Public License v3.0
9.07k stars 509 forks source link

Error occurs when creating a materialised view from a Kafka source. #2774

Open PavelShilin89 opened 1 day ago

PavelShilin89 commented 1 day ago

Bug Description:

The error indicates that the selected source does not exist, even though it was created and is visible via SHOW SOURCES.

MRE

--------------
CREATE SOURCE kafka (id bigint, term text, abbrev text, GlossDef json) type='kafka' broker_list='kafka:9092' topic_list='my-data' consumer_group='manticore' num_consumers='1' batch=50
--------------
CREATE TABLE destination_kafka (id bigint, name text, short_name text, received_at text, size multi)
--------------
SHOW SOURCES
--------------
+-------+
| name  |
+-------+
| kafka |
+-------+
--------------
CREATE MATERIALIZED VIEW view_table TO destination_kafka AS SELECT id, term as name, abbrev as short_name, UTC_TIMESTAMP() as received_at, GlossDef.size as size FROM kafka
--------------

Current Result

ERROR 1064 (42000) at line 1: Chosen source not exist

Expected Result The CREATE MATERIALIZED VIEW command should execute successfully, and SHOW MV view_table should display

--------------
SHOW MV view_table
--------------
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+
| View       | Create Table                                                                                                                                                                | suspended |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+
| view_table | CREATE MATERIALIZED VIEW view_table TO destination_kafka AS SELECT id, term as name, abbrev as short_name, UTC_TIMESTAMP() as received_at, GlossDef.size as size FROM kafka | 0         |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------+

On the latest dev version, a different error occurs:

--------------
CREATE SOURCE kafka (id bigint, term text, abbrev text, GlossDef json) type='kafka' broker_list='kafka:9092' topic_list='my-data' consumer_group='manticore' num_consumers='1' batch=50;"; echo $?
--------------
ERROR 1064 (42000) at line 1: P03: syntax error, unexpected tablename, expecting CLUSTER or FUNCTION or PLUGIN or TABLE near 'SOURCE kafka (id bigint, term text, abbrev text, GlossDef json) type='kafka' broker_list='kafka:9092' topic_list='my-data' consumer_group='manticore' num_consumers='1' batch=50'

Manticore Search Version:

Manticore 6.3.7 d278eb071@24111916 dev (columnar 2.3.1 30ad2d6@24100914) (secondary 2.3.1 30ad2d6@24100914) (knn 2.3.1 30ad2d6@24100914)

Operating System Version:

Ubuntu Jammy

Have you tried the latest development version?

Yes

Internal Checklist:

To be completed by the assignee. Check off tasks that have been completed or are not applicable.

- [ ] Implementation completed - [ ] Tests developed - [ ] Documentation updated - [ ] Documentation reviewed - [ ] [Changelog](https://docs.google.com/spreadsheets/d/1mz_3dRWKs86FjRF7EIZUziUDK_2Hvhd97G0pLpxo05s/edit?pli=1&gid=1102439133) updated