WangYa002 commented on issue #59692:
URL: https://github.com/apache/doris/issues/59692#issuecomment-3851909905
Here's a professional and clear reply you can send via email:
Hi Lucien,
Thanks for testing this on version 3.0.8 and sharing your results.
I can confirm that the behavior you're seeing is consistent with my
observations. Cases 1 and 2 work as expected, but Case 3 still throws the Not
support comparison between JSONB literals error.
This does appear to be related to the underlying issue in #53291. It seems
the fix for #59692 addressed single JSON_CONTAINS calls, but the problem
persists when chaining multiple JSON_CONTAINS functions with AND / OR logic
in the WHERE clause. The query planner is still incorrectly treating the
boolean return values as JSONB types for comparison.
As a temporary workaround before the core issue is fixed, you can use
JSON_ARRAY_CONTAINS_AGG to combine the conditions:
sql
SELECT * FROM table WHERE JSON_ARRAY_CONTAINS_AGG('["1","2","3"]', '"1"',
'"2"') limit 100;
Or explicitly cast the result to BOOLEAN :
sql
SELECT * FROM table WHERE CAST(JSON_CONTAINS(...) AS BOOLEAN) AND
CAST(JSON_CONTAINS(...) AS BOOLEAN) limit 100;
Let's keep an eye on the PRs linked to #53291 for the permanent fix.
Best regards,
wangyang002
---- Replied Message ----
| From | ***@***.***> |
| Date | 02/05/2026 16:34 |
| To | ***@***.***> |
| Cc | ***@***.***>***@***.***> |
| Subject | Re: [apache/doris] [Bug] (json) incorrect results of
json_contains (Issue #59692) |
lucienlgl left a comment (apache/doris#59692)
I tried using a higher version 3.0.8, the case 1&2 met the expectations, but
case 3 still returned the same error message. Is this issue consistent with
#53291 as well?
Case3: SELECT * FROM table WHERE JSON_CONTAINS('["1","2","3"]', '"1"') and
JSON_CONTAINS('["1","2","3"]', '"2"') limit 100;
--- return: [HY000][1105] errCode = 2, detailMessage = Not support
comparison between JSONB literals
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]