Open b17k0 opened 5 days ago
Some very early investigation into the issue:
An easier (to set up) reproducer is to try total_quantity:2
query on kibana_sample_data_ecommerce
(total_quantity
is also an Int64) in the example environment (https://github.com/QuesmaOrg/quesma/tree/main/examples/kibana-sample-data)
The total_query:2
query in "Discover" view in Kibana results in the following Elastic query (from "Live tail" of localhost:9999 Quesma debug interface):
{
"_source": {
"excludes": []
},
"aggs": {
"0": {
"date_histogram": {
"field": "order_date",
"fixed_interval": "30d",
"min_doc_count": 1,
"time_zone": "Europe/Warsaw"
}
}
},
"fields": [
{
"field": "@timestamp",
"format": "date_time"
},
{
"field": "customer_birth_date",
"format": "date_time"
},
"..."
],
"query": {
"bool": {
"filter": [
{
"bool": {
"minimum_should_match": 1,
"should": [
{
"match": {
"total_quantity": "2"
}
}
]
}
},
{
"range": {
"order_date": {
"format": "strict_date_optional_time",
"gte": "2009-11-20T16:38:05.713Z",
"lte": "2024-11-20T16:38:05.713Z"
}
}
}
],
"must": [],
"must_not": [],
"should": []
}
},
"runtime_mappings": {},
"script_fields": {},
"size": 0,
"stored_fields": [
"*"
],
"track_total_hits": true
}
and this causes the same exact problem:
Q3006: Unspecified database error. clickhouse: query failed. err: code: 43, message: Illegal type Int64 of argument of function ilike
The ILIKE
comes from this place in Quesma: https://github.com/QuesmaOrg/quesma/blob/6b5c479ab1a60bd0124ab5891bc452cafa042af2/quesma/queryparser/query_parser.go#L591
Confirmed that Elastic handles this query as expected correctly.
Hello! If you add a filter for the Int64 field in kibana, you will prevent this error:
My clickhouse schema:
My schemaOverrides:
In addition to the error itself, it is also strange that for the operator
is
in the kibana filter, it would be more correct to useid == '99999999999'
instead ofid ILIKE '%99999999999%'
.