Repository navigation
Closed as not planned
Labels
enhancementNew feature or request
Description
Continuation of #1112.
Reference: https://faridrener.com/2018/05/07/es-multiple-datatypes.html
Is your feature request related to a problem?
DSL search requires exact types to match a function signature, but text fields could be of any type.
Mapping:
{
"mappings": {
"properties": {
"TextWithMixedFields" : {
"type" : "text",
"fields" : {
"numeric": {
"type": "double",
"ignore_malformed": true
},
"date": {
"type": "date",
"format": "dd.MM.uuuu",
"ignore_malformed": true
}
}
}
}
}
}Data:
{"index": {}}
{ "TextWithMixedFields": "one two three" }
{"index": {}}
{ "TextWithMixedFields": 42 }
{"index": {}}
{ "TextWithMixedFields": "12.04.1961" }Query 1:
select * from dbg where TextWithMixedFields > 0Error:
{
"reason": "Invalid SQL query",
"details": "> function expected {[BYTE,BYTE],[SHORT,SHORT],[INTEGER,INTEGER],[LONG,LONG],[FLOAT,FLOAT],[DOUBLE,DOUBLE],[TEXT,TEXT],[STRING,STRING],[BOOLEAN,BOOLEAN],[DATE,DATE],[TIME,TIME],[DATETIME,DATETIME],[TIMESTAMP,TIMESTAMP],[INTERVAL,INTERVAL],[STRUCT,STRUCT],[ARRAY,ARRAY]}, but get [STRING,INTEGER]",
"type": "ExpressionEvaluationException"
}Query 2:
select * from dbg where TextWithMixedFields.numeric > 0;Error:
{
"reason": "Invalid SQL query",
"details": "can't resolve Symbol(namespace=FIELD_NAME, name=TextWithMixedFields.numeric) in type env",
"type": "SemanticCheckException"
}What solution would you like?
A user should be able to search text for all type of fields.
Query 1:
select * from dbg where TextWithMixedFields > 0Should fail with another error message OR automatically resolve field name and behave as second query.
Query 2:
select * from dbg where TextWithMixedFields.numeric > 0;Should return
+-----------------------+
| TextWithMixedFields |
|-----------------------|
| 42 |
+-----------------------+
What alternatives have you considered?
N/A
Do you have any additional context?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity