sqldelight / sqldelight/sql-psi

H2 YEAR function not supported

Open
#652 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Kotlin
Stars
104
Forks
35
Avg merge
1h 11m
Merged PRs (30d)
14

Description

Failing ANSI SQL
SELECT YEAR(PAYMENTARRIVETIME) AS YEAR, MONTH(PAYMENTARRIVETIME) AS MONTH, SUM(CAST(QUANTITY AS INT)) AS QUANTITY, SUM(CAST(YOURNETPROFIT AS DECIMAL(10,3))) AS YOURNETPROFIT FROM import
GROUP BY YEAR(PAYMENTARRIVETIME), MONTH(PAYMENTARRIVETIME)
ORDER BY YEAR(PAYMENTARRIVETIME), MONTH(PAYMENTARRIVETIME);
Description

The YEAR function is not recognized

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failing ANSI SQL query in the parser and trace how YEAR(PAYMENTARRIVETIME) is handled. Identify the relevant function recognition or parsing entry point, then verify that the query parses successfully while preserving the YEAR expression in GROUP BY and ORDER BY.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.