Open AbstractiveNord opened 1 year ago
SELECT 'string' as string, data FROM table_name; --doesn't work
Please elaborate on why it's important to have this implemented.
I have several cases with tools like Grafana and others, when returning abstract strings is required for specific plugins. For example, I want to enrich data from ManticoreSearch with static data, internal data from Grafana, using Variables, or even with data from another requests. Also popular use case is returning static data under IF statement.
it could be better to provide more examples of the feature as implement of plain select SELECT 'string' as s
differs from the expression like SELECT if (attr1<b, 'string', attr2) as s
I'll prepare more examples today.
I have several cases with tools like Grafana and others, when returning abstract strings is required for specific plugins
How we can reproduce the issue with Grafana? You are probably using our recent Grafana integration and in this case if it's not working fine with Grafana, the task makes perfect sense and the required functionality should be implemented as a part of the integration (i.e. Buddy plugin), but there may be some specificity, so please provide the details.
How we can reproduce the issue with Grafana? You are probably using our recent Grafana integration and in this case if it's not working fine with Grafana, the task makes perfect sense and the required functionality should be implemented as a part of the integration (i.e. Buddy plugin), but there may be some specificity, so please provide the details.
I use MySQL datasource with ManticoreSearch and it's work good. You can reproduce the issue using mysql console client, because it's identical with behavior of datasource. Performance of requests with static data are important, so I am not sure about implementing through Buddy. Simplest usecase of this feature is Logs dashboard for non-logs data. Let's say:
CREATE TABLE example(level integer, data text);
INSERT INTO example(level, data) VALUES (1, 'text');
SELECT 'info' as level, data as message, now() as time FROM example; --doesn't work
Also problem with string inside IFs
mysql> SELECT if (1 = 2, 1, 2);
+------------------+
| if (1 = 2, 1, 2) |
+------------------+
| 2 |
+------------------+
1 row in set (0,00 sec)
mysql> SELECT if ('test' = 'test', 1, 2);
ERROR 1064 (42000): P01: syntax error, unexpected ',', expecting '=' near ', 1, 2)'
it could be better to provide more examples of the feature as implement of plain select
SELECT 'string' as s
differs from the expression likeSELECT if (attr1<b, 'string', attr2) as s
mysql> SELECT if (attr1<b, 'string', attr2) as s;
ERROR 1064 (42000): if() arguments can not be string
Describe the bug
To Reproduce Steps to reproduce the behavior:
Expected behavior
Describe the environment: Server version: 6.2.0 45680f95d@230804 git branch manticore-6.2.0...origin/manticore-6.2.0