You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Danny Chan (JIRA)" <ji...@apache.org> on 2019/07/30 01:43:00 UTC

[jira] [Commented] (CALCITE-3218) Syntax error while parsing DATEADD

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

Danny Chan commented on CALCITE-3218:
-------------------------------------

Thanks [~lindseycat] for reporting this, it's better if you can give a test case which can reproduce this problem in Calcite, it would help the contributors who has willingness on this issue (more easier to give a fix).

> Syntax error while parsing DATEADD
> ----------------------------------
>
>                 Key: CALCITE-3218
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3218
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Lindsey Meyer
>            Assignee: Julian Hyde
>            Priority: Major
>
> Syntax error while parsing DATEADD
> {code:java}
> SELECT 
> 	DATE(CONVERT_TIMEZONE('UTC', 'America/Los_Angeles', events.event_date )) AS "events.event_date",
> 	COALESCE(SUM(events.daily_user_count ), 0) AS "events.daily_active_users",
> 	COALESCE(SUM(events.monthly_user_count ), 0) AS "events.monthly_active_users"
> FROM public.events_proto  AS events
> WHERE 
> 	(((events.event_date ) >= ((CONVERT_TIMEZONE('America/Los_Angeles', 'UTC', DATEADD(day,-364, DATE_TRUNC('day',CONVERT_TIMEZONE('UTC', 'America/Los_Angeles', GETDATE())) )))) AND (events.event_date ) < ((CONVERT_TIMEZONE('America/Los_Angeles', 'UTC', DATEADD(day,365, DATEADD(day,-364, DATE_TRUNC('day',CONVERT_TIMEZONE('UTC', 'America/Los_Angeles', GETDATE())) ) ))))))
> GROUP BY 1
> HAVING 
> 	NOT (COALESCE(SUM(events.monthly_user_count ), 0) = 0)
> ORDER BY 1 DESC
> LIMIT 500{code}
>  
> {code:java}
> `Column 'year' not found in any table`
> `DATEADD(year,1,...`
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)