-
Notifications
You must be signed in to change notification settings - Fork 156
[BUG] SQL confusing type conversion for TIMESTAMP when using join #3204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Re-raised the same bug as here (opensearch-project/OpenSearch#16847), since it seems to be a more suitable place |
Turns out the other two issues aren't quite the same, the issue here is more to do with a difference in validation/supported function logic between the V1 and V2 engines. Out of scope for the current system, but this should be solved by the Calcite initiative. @ Calcite team: I left a TODO for this test 4a83cd7 in #3613, remove the |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
So given 2 indexes, with a matching field (to be used in a JOIN) and a timestamp field. When querying without a join, a
WHERE
clause likeWHERE t.timestamp > timestamp('2001-05-07 00:00:00')
will work andWHERE t.timestamp > 0
won't work since it's a TIMESTAMP field, that's what opensearch tell youBut, if you're using a
JOIN
, the behavior reverses, while the error becomes even more confusing than just "can't match type"WHERE t.timestamp > timestamp('2001-05-07 00:00:00')
now will not work andWHERE t.timestamp > 0
will with errorRelated component
Search
To Reproduce
Expected behavior
Expected to see timestamp filtering work when using a join. Also, since it's a timestamp, i'd also expect INTEGER to work both ways
Additional Details
Plugins
AFAIK, sql, it's a default OpenSearch AWS installation
Screenshots
I've put the whole repro above with error results, so don't really need it
Host/Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: