You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Shyam Sarkar <sh...@yahoo.com> on 2009/03/08 15:15:55 UTC

Please check grammar for TIMESTAMP

Hi Zheng and others,

Could you please check Hive.g grammar changes for TIMESTAMP (See the comments with // Change by Shyam)?
Please review and let me know your feedback. I shall write a short design doc later for review after these short exchanges.

Thanks,
shyam_sarkar@yahoo.com


      

RE: Please check grammar for TIMESTAMP

Posted by Shyam Sarkar <sh...@yahoo.com>.
Dear Ashish,

Thanks for the comment. I found the following things from MySQL 6.0 ::

(1) Inside CREATE TABLE, TIMESTAMP does not have any format. It is treated like a primitive type (string).

(2) Inside SELECT clause, TIMESTAMP(YYYYMMDDHHMMSS) is called as a routine with format information for output spec. 

===========  MySQL 6.0 function ===============================
TIMESTAMP(expr), TIMESTAMP(expr1,expr2) 
With a single argument, this function returns the date or datetime expression expr as a datetime value. With two arguments, it adds the time expression expr2 to the date or datetime expression expr1 and returns the result as a datetime value. 
mysql> SELECT TIMESTAMP('2003-12-31');
        -> '2003-12-31 00:00:00'
mysql> SELECT TIMESTAMP('2003-12-31 12:00:00','12:00:00');
        -> '2004-01-01 00:00:00'
===============================================================

As a result, we have to define TIMESTAMP as primitive type as well as a complex type with format information.  I have to upgrade the grammar after further inspection. I am going to add a basic design document to JIRA.

Please provide suggestions.

Thanks,
Shyam


--- On Mon, 3/9/09, Ashish Thusoo <at...@facebook.com> wrote:

> From: Ashish Thusoo <at...@facebook.com>
> Subject: RE: Please check grammar for TIMESTAMP
> To: "hive-dev@hadoop.apache.org" <hi...@hadoop.apache.org>
> Date: Monday, March 9, 2009, 2:52 PM
> One immediate issue is that the format string is a lexical
> token, so a string of that format will not conform to the
> grammar at places where a string literal is expected. A
> better approach is to treat the format as a stringliteral
> and then do the format checks at the typecheck and semantic
> analysis time.
> 
> Ashish 
> 
> -----Original Message-----
> From: Shyam Sarkar [mailto:shyam_sarkar@yahoo.com] 
> Sent: Sunday, March 08, 2009 7:16 AM
> To: hive-dev@hadoop.apache.org
> Subject: Please check grammar for TIMESTAMP
> 
> Hi Zheng and others,
> 
> Could you please check Hive.g grammar changes for TIMESTAMP
> (See the comments with // Change by Shyam)?
> Please review and let me know your feedback. I shall write
> a short design doc later for review after these short
> exchanges.
> 
> Thanks,
> shyam_sarkar@yahoo.com


      

RE: Please check grammar for TIMESTAMP

Posted by Ashish Thusoo <at...@facebook.com>.
One immediate issue is that the format string is a lexical token, so a string of that format will not conform to the grammar at places where a string literal is expected. A better approach is to treat the format as a stringliteral and then do the format checks at the typecheck and semantic analysis time.

Ashish 

-----Original Message-----
From: Shyam Sarkar [mailto:shyam_sarkar@yahoo.com] 
Sent: Sunday, March 08, 2009 7:16 AM
To: hive-dev@hadoop.apache.org
Subject: Please check grammar for TIMESTAMP

Hi Zheng and others,

Could you please check Hive.g grammar changes for TIMESTAMP (See the comments with // Change by Shyam)?
Please review and let me know your feedback. I shall write a short design doc later for review after these short exchanges.

Thanks,
shyam_sarkar@yahoo.com


      

Re: Please check grammar for TIMESTAMP

Posted by Shyam Sarkar <sh...@yahoo.com>.
Yes there will be Timezone support. We shall follow MySQL 6.0 TIMESTAMP specification::

http://dev.mysql.com/doc/refman/6.0/en/timestamp.html

Thanks,
shyam_sarkar@yahoo.com


--- On Sun, 3/8/09, Tim Hawkins <ti...@bejant.com> wrote:

> From: Tim Hawkins <ti...@bejant.com>
> Subject: Re: Please check grammar for TIMESTAMP
> To: hive-dev@hadoop.apache.org
> Date: Sunday, March 8, 2009, 7:22 AM
> Is there going to be any Timezone Support?, ie will the
> time-stamp be stored in a recognised standard such as UTC
> regardless of the actual time submitted, given that
> hive/hadoop tend to be used for log processing and reporting
> in many use cases, understanding the normalising  time-zone
> details may be nessacary, especially where you may have data
> sourced from multiple time zones.
> 
> It may be worth considering this issue now as retrofitting
> it later may cause problems.
> 
> On 8 Mar 2009, at 14:15, Shyam Sarkar wrote:
> 
> > Hi Zheng and others,
> > 
> > Could you please check Hive.g grammar changes for
> TIMESTAMP (See the comments with // Change by Shyam)?
> > Please review and let me know your feedback. I shall
> write a short design doc later for review after these short
> exchanges.
> > 
> > Thanks,
> > shyam_sarkar@yahoo.com
> > 
> >


      

Re: Please check grammar for TIMESTAMP

Posted by Tim Hawkins <ti...@bejant.com>.
Is there going to be any Timezone Support?, ie will the time-stamp be  
stored in a recognised standard such as UTC regardless of the actual  
time submitted, given that hive/hadoop tend to be used for log  
processing and reporting in many use cases, understanding the  
normalising  time-zone details may be nessacary, especially where you  
may have data sourced from multiple time zones.

It may be worth considering this issue now as retrofitting it later  
may cause problems.

On 8 Mar 2009, at 14:15, Shyam Sarkar wrote:

> Hi Zheng and others,
>
> Could you please check Hive.g grammar changes for TIMESTAMP (See the  
> comments with // Change by Shyam)?
> Please review and let me know your feedback. I shall write a short  
> design doc later for review after these short exchanges.
>
> Thanks,
> shyam_sarkar@yahoo.com
>
>

Re: Please check grammar for TIMESTAMP

Posted by Prasad Chakka <pr...@facebook.com>.
Shyam,

It will be easier to track if you can upload the diff to JIRA.

Thanks,
Prasad


________________________________
From: Shyam Sarkar <sh...@yahoo.com>
Reply-To: <hi...@hadoop.apache.org>
Date: Sun, 8 Mar 2009 07:15:55 -0700
To: <hi...@hadoop.apache.org>
Subject: Please check grammar for TIMESTAMP

Hi Zheng and others,

Could you please check Hive.g grammar changes for TIMESTAMP (See the comments with // Change by Shyam)?
Please review and let me know your feedback. I shall write a short design doc later for review after these short exchanges.

Thanks,
shyam_sarkar@yahoo.com