Skip to content

Conversation

@BohuTANG
Copy link
Member

@BohuTANG BohuTANG commented Oct 29, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  • Accept ANSI realtime keywords so downstream tools can issue standard SQL without rewriting. Example (default fractional precision vs explicit precision):
    SELECT CURRENT_DATE(), CURRENT_TIME(), CURRENT_TIME(3);
    -- CURRENT_DATE()  -> 2024-04-18
    -- CURRENT_TIME()  -> 07:47:37.084123000
    -- CURRENT_TIME(3) -> 07:47:37.084
  • Reuse today() / now() internals and surface the new entry points in the function registry metadata and golden listings.
  • Extend sqllogic and golden coverage so we assert formatting, fractional precision handling, and error reporting (e.g. precision outside the range [0,9]).

Tests

  • Unit Test
  • Logic Test
  • Golden Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@BohuTANG BohuTANG marked this pull request as draft October 29, 2025 11:35
@BohuTANG BohuTANG changed the title Support CURRENT_DATE/TIME SQL keywords Support ANSI CURRENT_DATE/CURRENT_TIME keywords Oct 29, 2025
@BohuTANG BohuTANG changed the title Support ANSI CURRENT_DATE/CURRENT_TIME keywords feat: support ANSI CURRENT_DATE/CURRENT_TIME keywords Oct 29, 2025
@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Oct 29, 2025
@BohuTANG BohuTANG force-pushed the feat/current-date-time-aliases branch from 5f19294 to 3e30de2 Compare October 29, 2025 12:30
@BohuTANG BohuTANG requested a review from sundy-li October 29, 2025 13:26
@BohuTANG BohuTANG marked this pull request as ready for review October 29, 2025 13:26
@sundy-li
Copy link
Member

sundy-li commented Oct 29, 2025

https://neon.com/postgresql/postgresql-date-functions/postgresql-current_time

current_time should return timestamp with tz.

@BohuTANG BohuTANG marked this pull request as draft October 30, 2025 01:03
@BohuTANG BohuTANG force-pushed the feat/current-date-time-aliases branch from 74aef02 to 3e30de2 Compare October 30, 2025 02:36
@databendlabs databendlabs deleted a comment from github-actions bot Oct 30, 2025
@BohuTANG BohuTANG marked this pull request as ready for review October 30, 2025 03:31
@BohuTANG
Copy link
Member Author

https://neon.com/postgresql/postgresql-date-functions/postgresql-current_time

current_time should return timestamp with tz.

current_time now align with postgresql and snowflake.

@BohuTANG BohuTANG merged commit 09c3a18 into main Oct 30, 2025
100 checks passed
@BohuTANG BohuTANG deleted the feat/current-date-time-aliases branch October 30, 2025 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants