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

Julian Hyde edited comment on CALCITE-5135 at 5/14/22 8:07 PM:
---------------------------------------------------------------

In the jira subject and the commit message can you describe the feature that 
you are adding. Not what code you changed, or the bug that you perceive existed.

You've added a test for JDBC fn DAY. Is DAY even a valid JDBC function?

You've not added a test for the DAY function. 

The TIMESTAMP function should be a separate JIRA case. Can you make a case 
whether it should be in Calcite's Core dialect, or in Babel, or enabled in 
particular libraries (e.g. mysql). Note that the oracle.com link you cite above 
is javadb, i.e. Apache Derby, not the Oracle RDMBS.


was (Author: julianhyde):
In the jira subject and the commit message can you describe the feature that 
you are adding. Not what code you changed, or the bug that you perceive existed.

You've added a test for JDBC fn DAY. Is DAY even a valid JDBC function?

You've not added a test for the DAY function. 

The TIMESTAMP function should be a separate JIRA case. Can you make a case 
whether it should be in Calcite's Core dialect, or in Babel, or enabled in 
particular libraries (e.g. oracle, mysql). 

> Planner#parse can't parse DAY() function
> ----------------------------------------
>
>                 Key: CALCITE-5135
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5135
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.30.0
>            Reporter: Mitsunori Komatsu
>            Priority: Major
>
> Hi team,
> I might be missing something, but `Planner#parse` can't parse `DAY()` 
> function while it can parse other YEAR(), MONTH(), HOUR() and so on.
>  
> {code:java}
> import org.apache.calcite.sql.parser.SqlParseException;
> import org.apache.calcite.sql.validate.SqlValidator;
> import org.apache.calcite.tools.FrameworkConfig;
> import org.apache.calcite.tools.Frameworks;
> import org.apache.calcite.tools.Planner;
> public class Main {
>     public static void main(String[] args) throws SqlParseException {
>         FrameworkConfig config = Frameworks.newConfigBuilder().build();
>         {
>             Planner planner = Frameworks.getPlanner(config);
>             System.out.println(planner.parse("select months(t) from tbl"));
>         }
>         {
>             Planner planner = Frameworks.getPlanner(config);
>             System.out.println(planner.parse("select month(t) from tbl"));
>         }
>         {
>             Planner planner = Frameworks.getPlanner(config);
>             System.out.println(planner.parse("select hours(t) from tbl"));
>         }
>         {
>             Planner planner = Frameworks.getPlanner(config);
>             System.out.println(planner.parse("select hour(t) from tbl"));
>         }
>         {
>             Planner planner = Frameworks.getPlanner(config);
>             System.out.println(planner.parse("select days(t) from tbl"));
>         }
>         {
>             Planner planner = Frameworks.getPlanner(config);
>             // This throws `org.apache.calcite.sql.parser.SqlParseException: 
> Encountered "day" ...`
>             System.out.println(planner.parse("select day(t) from tbl"));
>         }
>     }
> }
>  {code}
> Is this a bug? Is there any way to parse DAY() function? Thanks.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to