[
https://issues.apache.org/jira/browse/KYLIN-3460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16550584#comment-16550584
]
Temple Zhou commented on KYLIN-3460:
------------------------------------
I also fount that the Kylin 2.1.0 can execute the query
{noformat}
SELECT {fn CURRENT_TIMESTAMP(0)} AS "COL"
&
SELECT CURRENT_TIMESTAMP(0) AS "COL"
{noformat}
However, the Kylin 2.4.0 can only execute the query
{noformat}
SELECT CURRENT_TIMESTAMP(0) AS "COL"
{noformat}
When I execute the SELECT {fn CURRENT_TIMESTAMP(0)} AS "COL" with Kylin 2.4.0,
the error are as below:
{noformat}
>From line 1, column 8 to line 1, column 32: Function {fn CURRENT_TIMESTAMP} is
>not defined while executing SQL: SELECT \{fn CURRENT_TIMESTAMP(0)\} AS COL
>LIMIT 50000
{noformat}
> {fn CURRENT_DATE()} parse error
> -------------------------------
>
> Key: KYLIN-3460
> URL: https://issues.apache.org/jira/browse/KYLIN-3460
> Project: Kylin
> Issue Type: Bug
> Components: Driver - ODBC, Query Engine
> Affects Versions: v2.3.0, v2.3.1, v2.4.0
> Reporter: Temple Zhou
> Priority: Critical
>
> Dear all,
> I'm facing a very critical problem. When I use Tableau 10.5 with Kylin 2.1.0,
> the Tableau Server will send many SQL with "{fn CURRENT_DATE()}" via ODBC
> Driver(2.1.0), and the Kylin Server 2.1.0 will parse the CURRENT_DATE() to
> "2018-07-20 00:00:00"(the real current date). the logs are as below
> {noformat}
> Query Id: 14e7b152-6be0-4539-8fd0-c28bbffa6b25
> SQL: SELECT "APP_DAILY_ACTIVE_USER_PROPERTY_DI"."AV" AS "AV",
> COUNT(DISTINCT "APP_DAILY_ACTIVE_USER_PROPERTY_DI"."MC") AS
> "usr_Calculation_267682710052360192_ok"
> FROM "ADL"."APP_DAILY_ACTIVE_USER_PROPERTY_DI"
> "APP_DAILY_ACTIVE_USER_PROPERTY_DI"
> LEFT JOIN "DIM"."APP" "APP" ON ("APP_DAILY_ACTIVE_USER_PROPERTY_DI"."AC" =
> "APP"."ID")
> INNER JOIN "DIM"."CALENDAR" "CALENDAR" ON
> ("APP_DAILY_ACTIVE_USER_PROPERTY_DI"."ACTION_DT" = "CALENDAR"."CAL_DT")
> WHERE ((CAST("APP_DAILY_ACTIVE_USER_PROPERTY_DI"."ACTION_DT" AS TIMESTAMP) >=
> {ts '2018-06-20 00:00:00'})
> AND (CAST("APP_DAILY_ACTIVE_USER_PROPERTY_DI"."ACTION_DT" AS
> TIMESTAMP) < {ts '2018-07-20 00:00:00'})
> AND ("APP"."NAME" = 'xxx'))
> GROUP BY "APP_DAILY_ACTIVE_USER_PROPERTY_DI"."AV"
> User: ADMIN
> Success: true
> Duration: 0.06
> Project: app
> {noformat}
> However, recently, I upgrade my Kylin Server to 2.3.1 even 2.4.0, then there
> are many Tableau reports get the same error due to the SQL contain {fn
> CURRENT_DATE()}
> [Tableau Error
> Image|https://ws3.sinaimg.cn/large/006tKfTcgy1ftfbzshgs1j30fc0g2dhi.jpg]
> Besides, I found that the logs(2.3.1&2.4.0) are different from the
> logs(2.1.0), the logs(2.4.0) are as below
> {noformat}
> Query Id: b160f20c-84e4-4b81-bfe9-54ed22a723d6
> SQL: SELECT "APP_DAILY_ACTIVE_USER_PROPERTY_DI"."AV" AS "AV",
> COUNT(DISTINCT "APP_DAILY_ACTIVE_USER_PROPERTY_DI"."MC") AS
> "usr_Calculation_267682710052360192_ok"
> FROM "ADL"."APP_DAILY_ACTIVE_USER_PROPERTY_DI"
> "APP_DAILY_ACTIVE_USER_PROPERTY_DI"
> LEFT JOIN "DIM"."APP" "APP" ON ("APP_DAILY_ACTIVE_USER_PROPERTY_DI"."AC" =
> "APP"."ID")
> INNER JOIN "DIM"."CALENDAR" "CALENDAR" ON
> ("APP_DAILY_ACTIVE_USER_PROPERTY_DI"."ACTION_DT" = "CALENDAR"."CAL_DT")
> WHERE ((CAST("APP_DAILY_ACTIVE_USER_PROPERTY_DI"."ACTION_DT" AS TIMESTAMP) >=
> {fn TIMESTAMPADD(SQL_TSI_DAY,-29,{fn CURRENT_DATE()})})
> AND (CAST("APP_DAILY_ACTIVE_USER_PROPERTY_DI"."ACTION_DT" AS
> TIMESTAMP) < {fn TIMESTAMPADD(SQL_TSI_DAY,1,{fn CURRENT_DATE()})})
> AND ("APP"."NAME" = 'xxx')
> AND ("APP"."PLATFORM" = 'Android'))
> GROUP BY "APP_DAILY_ACTIVE_USER_PROPERTY_DI"."AV"
> User: ADMIN
> Success: false
> Duration: 0.029
> Project: app
> {noformat}
> The problem that bothers me the most is that why the older version can parse
> the "fn CURRENT_DATE()" but the newer can't. :( :( :(
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)