Skip to content

SQL Plugin returns double instead of date type for functions NOW() and CURDATE() [BUG] #260

@ghost

Description

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:

  1. Load the calcs table on to the server
  2. 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
image

Host/Environment (please complete the following information):

  • OS: Windows 10
  • Version 21H1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions