generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 181
Closed
Labels
PPLPiped processing languagePiped processing languagebugSomething isn't workingSomething isn't working
Description
What is the bug?
When operations transform numeric fields to produce non-numeric string values (e.g., "30-40", "20-25"), the response parser fails. The aggregation itself executes correctly in OpenSearch, but parsing the response fails because the parser uses type information that is not updated.
How can one reproduce the bug?
This issue affects multiple operations that transform field types:
Example 1: bin command produces range strings
curl -X POST "localhost:9200/_plugins/_ppl" \
-H "Content-Type: application/json" \
-d '{"query":"source=accounts | bin age span=10 | stats count() by age"}'
Error: For input string: "30-40"
Example 2: eval with string concatenation
curl -X POST "localhost:9200/_plugins/_ppl" \
-H "Content-Type: application/json" \
-d '{"query":"source=accounts | eval age = CAST(age AS STRING) + \"-25\" | stats count() by age | head 3"}'
Error: For input string: "20-25"
Both fail with:
{
"error": {
"reason": "There was internal problem at backend",
"details": "java.sql.SQLException: exception while executing query: For input string: \"20-25\"",
"type": "RuntimeException"
},
"status": 500
}
What is the expected behavior?
Expected for bin command:
{
"schema": [
{"name": "count()", "type": "bigint"},
{"name": "age", "type": "string"}
],
"datarows": [
[451, "20-30"],
[504, "30-40"],
[45, "40-50"]
]
}
Expected for eval with concatenation:
{
"schema": [
{"name": "count()", "type": "bigint"},
{"name": "age", "type": "string"}
],
"datarows": [
[44, "20-25"],
[46, "21-25"],
[51, "22-25"]
]
}
Do you have any additional context?
- This issue was initially discovered with the bin command but affects any operation that transforms field types to produce non-numeric strings
- The extendTypeMapping method uses
putIfAbsentwhich was designed to prevent overwriting field types
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PPLPiped processing languagePiped processing languagebugSomething isn't workingSomething isn't working
Type
Projects
Status
Done