Skip to content

[BUG] OpenSearch does not support timestamp format {ts 'YYYY-MM-DD hh:mm:ss'} #364

Closed

Description

Describe the bug
OpenSearch does not support timestamp format {ts 'YYYY-MM-DD hh:mm:ss'} which results in date filters on PowerBI to fail.

To Reproduce
Or for query issues:

  1. Start OpenSearch server
  2. Run the query 'SELECT {ts '1975-11-12 00:00:00'}'
  3. See error 'Invalid SQL query'

Expected behavior
This query should have the same result as TIMESTAMP('1975-11-12 00:00:00')

Screenshots
image

Additional context
Used OpenSearch version 1.2.0

Activity

  1. ghost added on Jan 6, 2022
  2. ghost added
    bug
    on Jan 6, 2022
  3. dai-chen commented on Aug 22, 2022

    @dai-chen
    Collaborator

    The date format is supported actually. The problem seems in TS syntax is missing:

    curl -XPOST "localhost:9200/_plugins/_sql" -H 'Content-Type: application/json' -d '
    {
      "query": "SELECT timestamp('\''1975-11-12 00:00:00'\'') "
    }
    '
    {
      "schema": [
        {
          "name": "timestamp('1975-11-12 00:00:00')",
          "type": "timestamp"
        }
      ],
      "datarows": [
        [
          "1975-11-12 00:00:00"
        ]
      ],
      "total": 1,
      "size": 1,
      "status": 200
    }
    
  4. Yury-Fridlyand commented on Aug 22, 2022

    @Yury-Fridlyand
    Collaborator

    Should we add it?

  5. added
    legacy
    on Aug 24, 2022
  6. acarbonetto commented on Jun 26, 2023

    @acarbonetto
    Collaborator

    note: also support {d }, {dt }, and {t } formats from ODFE driver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglegacypowerBI

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions