Skip to content

Conversation

Copy link

Copilot AI commented Jan 30, 2026

The request was to add full FE/BE support, constant folding, and regression coverage for the century SQL function (DuckDB semantics). After review, the repository already contains these implementations and tests, so no code changes were necessary.

  • Verification
    • FE scalar function, Builtin registry, and constant folding hooks already include century.
    • BE execution path includes ToCenturyImpl and is registered for DateV2/DateTimeV2.
    • BE unit tests and regression suites already cover boundary cases.
// Existing FE constant folding logic
@ExecFunction(name = "century")
public static Expression century(DateV2Literal date) {
    return new SmallIntLiteral((short) ((date.getYear() - 1) / 100 + 1));
}

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Copilot AI changed the title [WIP] Add century SQL function with full implementation Century function already implemented across FE/BE Jan 30, 2026
Copilot AI requested a review from zclllyybb January 30, 2026 18:35
@zclllyybb zclllyybb closed this Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants