You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Mihai Budiu (Jira)" <ji...@apache.org> on 2025/12/04 23:42:00 UTC

[jira] [Commented] (CALCITE-5652) How to add a database-specific comment symbol

    [ https://issues.apache.org/jira/browse/CALCITE-5652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18042916#comment-18042916 ] 

Mihai Budiu commented on CALCITE-5652:
--------------------------------------

The Calcite parser is preprocessed using a template engine which looks at lines containing <#if ...> so you can customize the parser at build time.

> How to add a database-specific comment symbol
> ---------------------------------------------
>
>                 Key: CALCITE-5652
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5652
>             Project: Calcite
>          Issue Type: New Feature
>          Components: core
>    Affects Versions: 1.34.0
>            Reporter: Zine eddine Zidane
>            Priority: Minor
>
> Is there a clean way to add a database-specific comment symbol? for example, the hash symbol "#" is used for inline comments on Mysql, Postgres, and Oracle.
> A straightforward way is to just add it to the regular expression definition of the SINGLE_LINE_COMMENT keyword below but is this will make it a valid symbol regardless of a database which is not the intent
> {code:java}
> <DEFAULT, DQID, BTID, BQID, BQHID> SKIP :
> {
>     <SINGLE_LINE_COMMENT: ("//" | "--") (~["\n","\r"])* ("\r\n"|"\r"|"\n")?>
> } {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)