Description
Redash Version: 25.1.0
Environment:
- Self-hosted
- MongoDB data source
Issue Summary:
After upgrading to Redash v25.1.0, queries that reference cached query results (such as query_XXX tables created from MongoDB sources) fail with the following error:
Error running query: Error binding parameter 0 - probably unsupported type.
Direct MongoDB queries run successfully without errors, but when cached query results (query_XXX
) are used, even simple queries consistently fail.
Steps to Reproduce:
- Create a MongoDB aggregation query and save results as a cached query (
query_XXX
). - Attempt to execute a simple SQL query against the cached result, e.g.:
SELECT * FROM query_XXX LIMIT 10;
- Observe the error.
MongoDB Aggregation Example Causing Issue:
{
"collection": "devices",
"aggregate": [
{ "$match": { "cr_time": { "$gt": { "$humanTime": "2024-01-01 00:00" }}, "msisdn": { "$type": 2 }}},
{ "$project": { "cr_time": 1, "msisdn": { "$toString": "$msisdn" }, "client": { "$toString": "$client" }}}
]
}
Expected Results:
Queries referencing cached MongoDB results execute without errors.
Actual Results:
Queries referencing cached MongoDB results fail consistently with:
Error running query: Error binding parameter 0 - probably unsupported type.
Attempted Workarounds (unsuccessful):
- Explicitly casting fields to strings in MongoDB (
$toString
,$convert
). - Creating intermediate SQL tables with explicit type casting.
- Restarting Redash services.
Additional Information:
- Direct queries to MongoDB execute successfully.
- Error occurs only when referencing cached query results.
Request:
Please investigate the underlying issue with cached query result handling from MongoDB in Redash v25.1.0.