Closed n-arakawa closed 2 years ago
The problem might be that the plugin needs to determine the data type from the data itself. When there is no data this is not easily done and string is probably just the default.
Can you explain the issue this is causing?
The problem might be that the plugin needs to determine the data type from the data itself.
Types of database column is correct even with empty result. Therefor I guess SQLite has a API to get type information of columns. I'm not sure whether there is corresponding API for "Expression" column.
Can you explain the issue this is causing?
My use case is quite a edge one,
I found work around for this. I use "UNION ALL" in SQL and remove "Merge" Transformation. Everything is fine now.
Yeah. I would also suggest to do this in SQL if possible. UNION ALL
seems like the best way to go here.
If this is causing more issues, let's revisit 👌🏻
Describe the bug I'm not sure this is a bug of this plugin or SQLite itself, I got 'number' type for "Expression" column even though its "Affinity" is "TEXT"
https://www.sqlite.org/datatype3.html#affinity_of_expressions
To Reproduce
With grafana explorer, type in query.
SELECT "a" WHERE 1=0
or
SELECT CAST("a" as TEXT) WHERE 1=0
The type of the column is 'number'.![number](https://user-images.githubusercontent.com/2455518/136710819-67881b36-f5b5-40a7-8981-87fc3095b352.png)
Without
![text](https://user-images.githubusercontent.com/2455518/136710959-d610d0fd-774e-420b-b4f1-718a21fe7676.png)
WHERE 1=0
, I got "string" typeSELECT CAST("a" as TEXT)
Versions (please complete the following information):