You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQL Plugin returns double instead of date type for functions NOW() and CURDATE() [BUG] #260
Describe the bug
Calling NOW() and CURDATE() returns NULL for the JDBC driver while calling NOW() and CURDATE() on the SQL Plugin returns the expected results
To Reproduce
Steps to reproduce the behavior:
Load the calcs table on to the server
Run a query with NOW() or CURDATE() to the SQL Plugin for example curl -XPOST http://localhost:9200/_plugins/_sql -u admin:admin --insecure -H 'Content-Type: application/json' -d '{"query": "SELECT CURDATE() FROM calcs LIMIT 1"}' for Windows Subsystem for Linux
Expected behavior
The output should be of some date type like date or datetime
Actual behavior
The output is of type double.
Screenshot
Host/Environment (please complete the following information):
ghost changed the title [-]JDBC driver returns null for functions NOW() and CURDATE() [BUG][/-][+]SQL Plugin returns double instead of date type for functions NOW() and CURDATE() [BUG][/+]on Nov 2, 2021
The new engine has not supported these functions, looks like the functions are executed in old engine. Should add such support in new query engine to address this issue
Activity
[-]JDBC driver returns null for functions NOW() and CURDATE() [BUG][/-][+]SQL Plugin returns double instead of date type for functions NOW() and CURDATE() [BUG][/+]Yury-Fridlyand commentedon Nov 3, 2021
See also #259. Perhaps this bug could be fixed in scope of #259.
chloe-zh commentedon Nov 13, 2021
The new engine has not supported these functions, looks like the functions are executed in old engine. Should add such support in new query engine to address this issue
chloe-zh commentedon Nov 13, 2021
related issue: #48
dai-chen commentedon Dec 14, 2022
I think this is already fixed along with the new impl in v2 engine. Tested in OpenSearch playground as below: