Skip to content

[BUG]Inconsistent WEEK behavior in the documentdb driver compared to other data sources #509

Open
@tjzhang-BQ

Description

@tjzhang-BQ

Environment

  • DocumentDB JDBC driver version: 1.4.4
  • DocumentDB server version: MongoDB v6.0.3
  • OS: MacOS Ventura 13.1
  • BI Tool or client name: DBeaver
  • BI Tool or client version: 22.3.5

Problem Description

  1. Steps to reproduce: As is noted in the SQL limitation document, EXTRACT for WEEK or WEEK() return an integer between 0 and 53. This is in line with the MongoDB interpretation of week numbers but other databases more commonly return a value between 1 and 53. While this follows the MongoDB behavior, it would be ideal to also have the option to use isoWeek which Mongo also supports get access to the week number in ISO 8601 format.
    Same goes for FLOOR(timestamp TO timeunit), basically things that have to do with week numbering.
  2. Expected behaviour: Week number in ISO 8601 format also being available
  3. Actual behaviour: Currently only supports 0-53 in WEEK
  4. Error message/stack trace: N/A
  5. Any other details that can be helpful: This would be desirable since while this does follow the Mongo behavior, the inconsistency with other databases leads to some difficulties in the development of database connectors using this driver, which can be easily resolved with the ISO format being an option. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions