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

Vladimir Sitnikov commented on CALCITE-2301:
--------------------------------------------

By the way, 

{code:java}    UTC_TIMESTAMP("utcTimestamp", Long.class),

    /** The time at which the current statement started executing. In
     * milliseconds after 1970-01-01 00:00:00, UTC. Required. */  <===!!!!  UTC
    CURRENT_TIMESTAMP("currentTimestamp", Long.class),

    /** The time at which the current statement started executing. In
     * milliseconds after 1970-01-01 00:00:00, in the time zone of the current
     * statement. Required. */
    LOCAL_TIMESTAMP("localTimestamp", Long.class),
....

      final TimeZone timeZone = connection.getTimeZone();
      final long localOffset = timeZone.getOffset(time);
      final long currentOffset = localOffset;
...
      builder.put(Variable.UTC_TIMESTAMP.camelName, time)
          .put(Variable.CURRENT_TIMESTAMP.camelName, time + currentOffset)  
<===!!!! offset
          .put(Variable.LOCAL_TIMESTAMP.camelName, time + localOffset)
          .put(Variable.TIME_ZONE.camelName, timeZone)
{code}

Frankly speaking, I don't like the concept of "time + currentOffset", however 
the more surprising fact is JavaDoc for CURRENT_TIMESTAMP reads {{milliseconds 
after 1970-01-01 00:00:00, UTC}}

> JDBC adapter: use query timeout from the top-level statement
> ------------------------------------------------------------
>
>                 Key: CALCITE-2301
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2301
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.16.0
>            Reporter: Fan Yang
>            Assignee: Julian Hyde
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: next
>
>
> It's not a good idea to have the magic number here. Also, databases may not 
> get back within 10 second for various reasons (e.g., in the case of JDBC 
> schema).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to