-
Notifications
You must be signed in to change notification settings - Fork 186
Comparing date, timestamp and string lead to failures and Date formatted as timestamp #1056
Comments
similar issue in opendistrocommunity. https://discuss.opendistrocommunity.dev/t/sql-plugin-date-filter-causes-error/4883 |
Also this I believe it's a breaking change |
yeah, I checked that our old engine can handle the queries without issue. The reason is no matter the field value, there is only one type called |
Issue may be related: #510 |
@dai-chen Shouldn't it fall back to the old one automatically when the query throws? If not, could we enable that fallback somehow? |
Yes, fall back happens automatically. However, mostly it happens during parsing. In particular, the ANTLR grammar in new engine decides if we should fall back. After that, the query is considered being able to handled by new engine. The semantic check like the error you saw is in this case. |
Is it possible that both kind of errors are forced to fallback to the old engine? There are a lot of great features in this release that I would love continuing using, but a few breaking changes that I can see could take several weeks+ to be solved. Recovering from both error types would get us the best from both worlds and help adoption |
Sure, thanks for helping us find this and other breaking changes! We're looking into all recent issues and will prepare PR for high priority ones. |
As additional data point, another valid format in Postgres is |
@FreCap sure, I'm working on a PR to support implicit cast. Will reference to MySQL and PostgreSQL. Thanks! |
Probably related: #803 |
I am also facing the same issue on date ranges, currently using between instead of > < signs to compare dates and strings. |
As fix you can use this branch @gauravlanjekar You can find the build here: |
@FreCap Unfortunaletly I am running opendistro with AWS ES. So I don't have the possibility to run the other branch. :( |
I tested with OpenSearch 1.1 which can support implicit conversion between Date and String. The following query worked for me:
I'm investigating why |
Hello Every One I am trying to change data type using query workbench I want to change data type date to timestamp using query for output schema in other DB but I am not able to do and opensearch having not supporting like cast kind of query any one can help it’s Urgent query - select timestamp(datecolumn) as date from table above query is not working plase help !!! |
Version 1.13 (might be a regression from previous versions)
The following query:
generates the following mapping specifying the field as DATE:
When I try to query it in different combinations that I feel should probably be acceptable, it always fail:
Case 1
Why the field is considered TIMESTAMP here instead of DATE (like in the mapping)?
It'd be very nice to have the two types (TIMESTAMP and STRING) comparable since we don't want the user to always know what kind of Date it is in the mapping
Case 2
Shouldn't TIMESTAMP and DATE be comparable?
Case 3
Case 4, working, but unexpected output
The text was updated successfully, but these errors were encountered: