SPLWare / SPLWare/esProc

sqltranslate函数不能正确的翻译 0 参数的函数;例如:TODAY(), NOW()

Open
#39 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.7k
Forks
364
PR merge metrics
No merged PRs in 30d

Description

    版本:
    <dependency>
        <groupId>com.scudata.esproc</groupId>
        <artifactId>esproc</artifactId>
        <version>20230228</version>
    </dependency>
    
    function.xml 中片段:
  <FUNCTION name="TODAY" paramcount="0">
    <INFO dbtype="ORACLE" value="SYSDATE"/>
    <INFO dbtype="SQLSVR" value="GETDATE()"/>
    <INFO dbtype="DB2" value="CURRENT DATE"/>
    <INFO dbtype="MYSQL" value="CURDATE()"/>
    <INFO dbtype="TERADATA" value="DATE"/>
    <INFO dbtype="POSTGRES" value="CURRENT_DATE"/>
    <INFO dbtype="ESPROC" value="now@d()"/>
  </FUNCTION>        

  System.out.println(SQLUtil.translate("TODAY()", "ORACLE"));   输出是 TODAY()  ;不符合 function.xml 中的配置

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 locating SQLUtil.translate and the function.xml entry for the zero-parameter TODAY function. Reproduce SQLUtil.translate("TODAY()", "ORACLE") and compare its output with the configured SYSDATE translation; done means zero-argument functions use their function.xml mappings without retaining TODAY().

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.