-
Notifications
You must be signed in to change notification settings - Fork 190
[BUG] Casting to IP is not supported with Calcite #3918
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingcalcitecalcite migration releatedcalcite migration releatedenhancementNew feature or requestNew feature or request
Description
What is the bug?
With Calcite, when I try to cast a value to IP, it fails with the following error:
os> source=weblogs | where cast('1.1.1.1' as ip)
{
"error": {
"reason": "Invalid Query",
"details": "Was not expecting value 'OTHER' for enumeration 'org.apache.calcite.sql.type.SqlTypeName' in this context",
"type": "CalciteUnsupportedException"
},
"status": 400
}How can one reproduce the bug?
curl --location 'http://localhost:9200/_plugins/_ppl' \
--header 'Content-Type: application/json' \
--data '{
"query" : "source=weblogs | head 1 | eval ip = cast('1.1.1.1' as ip) | fields ip"
}
'What is the expected behavior?
Return with the following schema and data (as in V2):
{
"schema": [
{
"name": "ip",
"type": "ip"
}
],
"datarows": [
[
"1.1.1.1"
]
],
"total": 1,
"size": 1
}What is your host/environment?
- OS: MacOS
- Version: 3.1.0
- Plugins: sql
Do you have any screenshots?
Do you have any additional context?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcalcitecalcite migration releatedcalcite migration releatedenhancementNew feature or requestNew feature or request
Type
Projects
Status
Done