• Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major Major
    • 8.10
    • None
    • Query Engine
    • None
    • Documentation (Ref Guide, User Guide, etc.), Release Notes

      For consistency we could enforce a standard iso behavior for the week function by default.

      For mysql there is the weekofyear function that matches the iso behavior.
      hsql uses iso by default
      oracle should use iw, not ww

      However:
      h2 uses the locale (the current teiid behavior)
      sqlserver/sybase you can use SET DATEFIRST to move the first day of the week to monday, but the return values are still not fully iso.

      And there are still several others to verify

            [TEIID-3282] inconsistencies with the week function

            Addressed the inconsistencies with the week function as much as possible. Teiid will default to the iso 8601 calculation for consistency and sources were updated to match. The dayOfWeek function was made to always return 1=sunday - 7=saturday regardless as that is part of the odbc standard and is matched by most sources - that is a slight change from the behavior that attempt to match the postgresql extract dow logic previous when the iso8601Week property was set.

            We could introduce specific iso_year and iso_day_of_week functions to further allow iso calculations.

            Steven Hawkins added a comment - Addressed the inconsistencies with the week function as much as possible. Teiid will default to the iso 8601 calculation for consistency and sources were updated to match. The dayOfWeek function was made to always return 1=sunday - 7=saturday regardless as that is part of the odbc standard and is matched by most sources - that is a slight change from the behavior that attempt to match the postgresql extract dow logic previous when the iso8601Week property was set. We could introduce specific iso_year and iso_day_of_week functions to further allow iso calculations.

            dayofweek is similarly affected.

            h2 has undocumented iso_week and iso_day_of_week functions that can be used.

            Steven Hawkins added a comment - dayofweek is similarly affected. h2 has undocumented iso_week and iso_day_of_week functions that can be used.

              rhn-engineering-shawkins Steven Hawkins
              rhn-engineering-shawkins Steven Hawkins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: