You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Gary Zhao <ga...@gmail.com> on 2013/09/26 20:34:02 UTC

Why "<" doesn't work?

Hello

I found something strange. I tried a few queries, in WHERE

1. ">" works, returns expected results
2. ">" and "<" doesn't work, returns 0 result
3. "<" doesn't work, return 0 result
4. BETWEEN, syntax error

Basically, I want to find records between to time stamps that are epoch
unix timestamps. Is there anything I did wrong?

Thanks
Gary

Re: Why "<" doesn't work?

Posted by Gary Zhao <ga...@gmail.com>.
select event from firstlaunchafterdownload where ds=20130926 and eventtime
> 1380204000 and  countrycode = 'US' limit 3;

Total MapReduce CPU Time Spent: 900 msec
OK
1380153600548
1380153622387
1380153641000


On Thu, Sep 26, 2013 at 1:07 PM, Dennis Chan <de...@denkc.com> wrote:

>  Or just select * with a limit as a check that your records are indeed
> all < 1390218015
>
>
>
> On 9/26/13 12:21 PM, j.barrett Strausser wrote:
>
> What is the result if you invert them? Meaning multiply by negative 1.
>
>
> On Thu, Sep 26, 2013 at 3:01 PM, Gary Zhao <ga...@gmail.com> wrote:
>
>>  For example,
>>
>> select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
>> eventtime > 1380204000 *and eventtime < 1390218015 *and
>> countrycode='US';
>>
>> Total MapReduce CPU Time Spent: 3 seconds 490 msec
>> OK
>>
>>  select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
>> eventtime > 1380204000 and  countrycode='US';
>> Total MapReduce CPU Time Spent: 3 seconds 860 msec
>> OK
>> 32581
>>
>> eventtime  is  bigint and I'm pretty sure all records are < 1390218015.
>>
>>
>>  Thanks
>> Gary
>>
>>
>>
>> On Thu, Sep 26, 2013 at 11:54 AM, Thejas Nair <th...@hortonworks.com>wrote:
>>
>>> Can you shares some examples of what does not work ?
>>>
>>>
>>> On Thu, Sep 26, 2013 at 11:34 AM, Gary Zhao <ga...@gmail.com> wrote:
>>> > Hello
>>> >
>>> > I found something strange. I tried a few queries, in WHERE
>>> >
>>> > 1. ">" works, returns expected results
>>> > 2. ">" and "<" doesn't work, returns 0 result
>>> > 3. "<" doesn't work, return 0 result
>>> > 4. BETWEEN, syntax error
>>> >
>>> > Basically, I want to find records between to time stamps that are
>>> epoch unix
>>> > timestamps. Is there anything I did wrong?
>>> >
>>> > Thanks
>>> > Gary
>>> >
>>>
>>>  --
>>> CONFIDENTIALITY NOTICE
>>> NOTICE: This message is intended for the use of the individual or entity
>>> to
>>> which it is addressed and may contain information that is confidential,
>>> privileged and exempt from disclosure under applicable law. If the reader
>>> of this message is not the intended recipient, you are hereby notified
>>> that
>>> any printing, copying, dissemination, distribution, disclosure or
>>> forwarding of this communication is strictly prohibited. If you have
>>> received this communication in error, please contact the sender
>>> immediately
>>> and delete it from your system. Thank You.
>>>
>>
>>
>
>
> --
>
>
> https://github.com/bearrito
>  @deepbearrito
>
>
>

Re: Why "<" doesn't work?

Posted by Dennis Chan <de...@denkc.com>.
Or just select * with a limit as a check that your records are indeed 
all < 1390218015


On 9/26/13 12:21 PM, j.barrett Strausser wrote:
> What is the result if you invert them? Meaning multiply by negative 1.
>
>
> On Thu, Sep 26, 2013 at 3:01 PM, Gary Zhao <garyzhao@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     For example,
>
>     select COUNT(*) from firstlaunchafterdownload where ds=20130926
>     and eventtime > 1380204000 *and eventtime < 1390218015 *and
>     countrycode='US';
>
>     Total MapReduce CPU Time Spent: 3 seconds 490 msec
>     OK
>
>      select COUNT(*) from firstlaunchafterdownload where ds=20130926
>     and eventtime > 1380204000 and countrycode='US';
>     Total MapReduce CPU Time Spent: 3 seconds 860 msec
>     OK
>     32581
>
>     eventtime  is  bigint and I'm pretty sure all records are <
>     1390218015.
>
>
>     Thanks
>     Gary
>
>
>
>     On Thu, Sep 26, 2013 at 11:54 AM, Thejas Nair
>     <thejas@hortonworks.com <ma...@hortonworks.com>> wrote:
>
>         Can you shares some examples of what does not work ?
>
>
>         On Thu, Sep 26, 2013 at 11:34 AM, Gary Zhao
>         <garyzhao@gmail.com <ma...@gmail.com>> wrote:
>         > Hello
>         >
>         > I found something strange. I tried a few queries, in WHERE
>         >
>         > 1. ">" works, returns expected results
>         > 2. ">" and "<" doesn't work, returns 0 result
>         > 3. "<" doesn't work, return 0 result
>         > 4. BETWEEN, syntax error
>         >
>         > Basically, I want to find records between to time stamps
>         that are epoch unix
>         > timestamps. Is there anything I did wrong?
>         >
>         > Thanks
>         > Gary
>         >
>
>         --
>         CONFIDENTIALITY NOTICE
>         NOTICE: This message is intended for the use of the individual
>         or entity to
>         which it is addressed and may contain information that is
>         confidential,
>         privileged and exempt from disclosure under applicable law. If
>         the reader
>         of this message is not the intended recipient, you are hereby
>         notified that
>         any printing, copying, dissemination, distribution, disclosure or
>         forwarding of this communication is strictly prohibited. If
>         you have
>         received this communication in error, please contact the
>         sender immediately
>         and delete it from your system. Thank You.
>
>
>
>
>
> -- 
>
>
> https://github.com/bearrito
> @deepbearrito


Re: Why "<" doesn't work?

Posted by Gary Zhao <ga...@gmail.com>.
Exactly. Thanks for finding it out. It helps a lot.


On Thu, Sep 26, 2013 at 1:55 PM, Dennis Chan <de...@denkc.com> wrote:

>  Those timestamps are in milliseconds, where your conditions are using
> seconds.
>
>
> On 9/26/13 1:50 PM, Gary Zhao wrote:
>
> Looks it worked.
>
> select eventtime from firstlaunchafterdownload where ds=20130926 and
> eventtime*-1 < 1390204000*-1 and  countrycode = 'US' limit 3;
>
> Total MapReduce CPU Time Spent: 850 msec
> OK
> 1380153600548
> 1380153622387
> 1380153641000
>
>
> On Thu, Sep 26, 2013 at 12:21 PM, j.barrett Strausser <
> j.barrett.strausser@gmail.com> wrote:
>
>> What is the result if you invert them? Meaning multiply by negative 1.
>>
>>
>> On Thu, Sep 26, 2013 at 3:01 PM, Gary Zhao <ga...@gmail.com> wrote:
>>
>>>  For example,
>>>
>>> select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
>>> eventtime > 1380204000 *and eventtime < 1390218015 *and
>>> countrycode='US';
>>>
>>> Total MapReduce CPU Time Spent: 3 seconds 490 msec
>>> OK
>>>
>>>  select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
>>> eventtime > 1380204000 and  countrycode='US';
>>> Total MapReduce CPU Time Spent: 3 seconds 860 msec
>>> OK
>>> 32581
>>>
>>> eventtime  is  bigint and I'm pretty sure all records are < 1390218015.
>>>
>>>
>>>  Thanks
>>> Gary
>>>
>>>
>>>
>>> On Thu, Sep 26, 2013 at 11:54 AM, Thejas Nair <th...@hortonworks.com>wrote:
>>>
>>>> Can you shares some examples of what does not work ?
>>>>
>>>>
>>>> On Thu, Sep 26, 2013 at 11:34 AM, Gary Zhao <ga...@gmail.com> wrote:
>>>> > Hello
>>>> >
>>>> > I found something strange. I tried a few queries, in WHERE
>>>> >
>>>> > 1. ">" works, returns expected results
>>>> > 2. ">" and "<" doesn't work, returns 0 result
>>>> > 3. "<" doesn't work, return 0 result
>>>> > 4. BETWEEN, syntax error
>>>> >
>>>> > Basically, I want to find records between to time stamps that are
>>>> epoch unix
>>>> > timestamps. Is there anything I did wrong?
>>>> >
>>>> > Thanks
>>>> > Gary
>>>> >
>>>>
>>>>  --
>>>> CONFIDENTIALITY NOTICE
>>>> NOTICE: This message is intended for the use of the individual or
>>>> entity to
>>>> which it is addressed and may contain information that is confidential,
>>>> privileged and exempt from disclosure under applicable law. If the
>>>> reader
>>>> of this message is not the intended recipient, you are hereby notified
>>>> that
>>>> any printing, copying, dissemination, distribution, disclosure or
>>>> forwarding of this communication is strictly prohibited. If you have
>>>> received this communication in error, please contact the sender
>>>> immediately
>>>> and delete it from your system. Thank You.
>>>>
>>>
>>>
>>
>>
>>  --
>>
>>
>> https://github.com/bearrito
>>  @deepbearrito
>>
>
>
>

Re: Why "<" doesn't work?

Posted by Dennis Chan <de...@denkc.com>.
Those timestamps are in milliseconds, where your conditions are using 
seconds.

On 9/26/13 1:50 PM, Gary Zhao wrote:
> Looks it worked.
>
> select eventtime from firstlaunchafterdownload where ds=20130926 and 
> eventtime*-1 < 1390204000*-1 and  countrycode = 'US' limit 3;
>
> Total MapReduce CPU Time Spent: 850 msec
> OK
> 1380153600548
> 1380153622387
> 1380153641000
>
>
> On Thu, Sep 26, 2013 at 12:21 PM, j.barrett Strausser 
> <j.barrett.strausser@gmail.com <ma...@gmail.com>> 
> wrote:
>
>     What is the result if you invert them? Meaning multiply by negative 1.
>
>
>     On Thu, Sep 26, 2013 at 3:01 PM, Gary Zhao <garyzhao@gmail.com
>     <ma...@gmail.com>> wrote:
>
>         For example,
>
>         select COUNT(*) from firstlaunchafterdownload where
>         ds=20130926 and eventtime > 1380204000 *and eventtime <
>         1390218015 *and countrycode='US';
>
>         Total MapReduce CPU Time Spent: 3 seconds 490 msec
>         OK
>
>          select COUNT(*) from firstlaunchafterdownload where
>         ds=20130926 and eventtime > 1380204000 and  countrycode='US';
>         Total MapReduce CPU Time Spent: 3 seconds 860 msec
>         OK
>         32581
>
>         eventtime  is  bigint and I'm pretty sure all records are <
>         1390218015.
>
>
>         Thanks
>         Gary
>
>
>
>         On Thu, Sep 26, 2013 at 11:54 AM, Thejas Nair
>         <thejas@hortonworks.com <ma...@hortonworks.com>> wrote:
>
>             Can you shares some examples of what does not work ?
>
>
>             On Thu, Sep 26, 2013 at 11:34 AM, Gary Zhao
>             <garyzhao@gmail.com <ma...@gmail.com>> wrote:
>             > Hello
>             >
>             > I found something strange. I tried a few queries, in WHERE
>             >
>             > 1. ">" works, returns expected results
>             > 2. ">" and "<" doesn't work, returns 0 result
>             > 3. "<" doesn't work, return 0 result
>             > 4. BETWEEN, syntax error
>             >
>             > Basically, I want to find records between to time stamps
>             that are epoch unix
>             > timestamps. Is there anything I did wrong?
>             >
>             > Thanks
>             > Gary
>             >
>
>             --
>             CONFIDENTIALITY NOTICE
>             NOTICE: This message is intended for the use of the
>             individual or entity to
>             which it is addressed and may contain information that is
>             confidential,
>             privileged and exempt from disclosure under applicable
>             law. If the reader
>             of this message is not the intended recipient, you are
>             hereby notified that
>             any printing, copying, dissemination, distribution,
>             disclosure or
>             forwarding of this communication is strictly prohibited.
>             If you have
>             received this communication in error, please contact the
>             sender immediately
>             and delete it from your system. Thank You.
>
>
>
>
>
>     -- 
>
>
>     https://github.com/bearrito
>     @deepbearrito
>
>


Re: Why "<" doesn't work?

Posted by Gary Zhao <ga...@gmail.com>.
Sorry doesn't work actually.

select eventtime from firstlaunchafterdownload where ds=20130926 and
*eventtime*-1
> 1390204000*-1* and  countrycode = 'US' limit 3;

Total MapReduce CPU Time Spent: 18 seconds 470 msec
OK


On Thu, Sep 26, 2013 at 1:50 PM, Gary Zhao <ga...@gmail.com> wrote:

> Looks it worked.
>
> select eventtime from firstlaunchafterdownload where ds=20130926 and
> eventtime*-1 < 1390204000*-1 and  countrycode = 'US' limit 3;
>
> Total MapReduce CPU Time Spent: 850 msec
> OK
> 1380153600548
> 1380153622387
> 1380153641000
>
>
> On Thu, Sep 26, 2013 at 12:21 PM, j.barrett Strausser <
> j.barrett.strausser@gmail.com> wrote:
>
>> What is the result if you invert them? Meaning multiply by negative 1.
>>
>>
>> On Thu, Sep 26, 2013 at 3:01 PM, Gary Zhao <ga...@gmail.com> wrote:
>>
>>> For example,
>>>
>>> select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
>>> eventtime > 1380204000 *and eventtime < 1390218015 *and
>>> countrycode='US';
>>>
>>> Total MapReduce CPU Time Spent: 3 seconds 490 msec
>>> OK
>>>
>>>  select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
>>> eventtime > 1380204000 and  countrycode='US';
>>> Total MapReduce CPU Time Spent: 3 seconds 860 msec
>>> OK
>>> 32581
>>>
>>> eventtime  is  bigint and I'm pretty sure all records are < 1390218015.
>>>
>>>
>>> Thanks
>>> Gary
>>>
>>>
>>>
>>> On Thu, Sep 26, 2013 at 11:54 AM, Thejas Nair <th...@hortonworks.com>wrote:
>>>
>>>> Can you shares some examples of what does not work ?
>>>>
>>>>
>>>> On Thu, Sep 26, 2013 at 11:34 AM, Gary Zhao <ga...@gmail.com> wrote:
>>>> > Hello
>>>> >
>>>> > I found something strange. I tried a few queries, in WHERE
>>>> >
>>>> > 1. ">" works, returns expected results
>>>> > 2. ">" and "<" doesn't work, returns 0 result
>>>> > 3. "<" doesn't work, return 0 result
>>>> > 4. BETWEEN, syntax error
>>>> >
>>>> > Basically, I want to find records between to time stamps that are
>>>> epoch unix
>>>> > timestamps. Is there anything I did wrong?
>>>> >
>>>> > Thanks
>>>> > Gary
>>>> >
>>>>
>>>> --
>>>> CONFIDENTIALITY NOTICE
>>>> NOTICE: This message is intended for the use of the individual or
>>>> entity to
>>>> which it is addressed and may contain information that is confidential,
>>>> privileged and exempt from disclosure under applicable law. If the
>>>> reader
>>>> of this message is not the intended recipient, you are hereby notified
>>>> that
>>>> any printing, copying, dissemination, distribution, disclosure or
>>>> forwarding of this communication is strictly prohibited. If you have
>>>> received this communication in error, please contact the sender
>>>> immediately
>>>> and delete it from your system. Thank You.
>>>>
>>>
>>>
>>
>>
>> --
>>
>>
>> https://github.com/bearrito
>> @deepbearrito
>>
>
>

Re: Why "<" doesn't work?

Posted by Gary Zhao <ga...@gmail.com>.
Looks it worked.

select eventtime from firstlaunchafterdownload where ds=20130926 and
eventtime*-1 < 1390204000*-1 and  countrycode = 'US' limit 3;

Total MapReduce CPU Time Spent: 850 msec
OK
1380153600548
1380153622387
1380153641000


On Thu, Sep 26, 2013 at 12:21 PM, j.barrett Strausser <
j.barrett.strausser@gmail.com> wrote:

> What is the result if you invert them? Meaning multiply by negative 1.
>
>
> On Thu, Sep 26, 2013 at 3:01 PM, Gary Zhao <ga...@gmail.com> wrote:
>
>> For example,
>>
>> select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
>> eventtime > 1380204000 *and eventtime < 1390218015 *and
>> countrycode='US';
>>
>> Total MapReduce CPU Time Spent: 3 seconds 490 msec
>> OK
>>
>>  select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
>> eventtime > 1380204000 and  countrycode='US';
>> Total MapReduce CPU Time Spent: 3 seconds 860 msec
>> OK
>> 32581
>>
>> eventtime  is  bigint and I'm pretty sure all records are < 1390218015.
>>
>>
>> Thanks
>> Gary
>>
>>
>>
>> On Thu, Sep 26, 2013 at 11:54 AM, Thejas Nair <th...@hortonworks.com>wrote:
>>
>>> Can you shares some examples of what does not work ?
>>>
>>>
>>> On Thu, Sep 26, 2013 at 11:34 AM, Gary Zhao <ga...@gmail.com> wrote:
>>> > Hello
>>> >
>>> > I found something strange. I tried a few queries, in WHERE
>>> >
>>> > 1. ">" works, returns expected results
>>> > 2. ">" and "<" doesn't work, returns 0 result
>>> > 3. "<" doesn't work, return 0 result
>>> > 4. BETWEEN, syntax error
>>> >
>>> > Basically, I want to find records between to time stamps that are
>>> epoch unix
>>> > timestamps. Is there anything I did wrong?
>>> >
>>> > Thanks
>>> > Gary
>>> >
>>>
>>> --
>>> CONFIDENTIALITY NOTICE
>>> NOTICE: This message is intended for the use of the individual or entity
>>> to
>>> which it is addressed and may contain information that is confidential,
>>> privileged and exempt from disclosure under applicable law. If the reader
>>> of this message is not the intended recipient, you are hereby notified
>>> that
>>> any printing, copying, dissemination, distribution, disclosure or
>>> forwarding of this communication is strictly prohibited. If you have
>>> received this communication in error, please contact the sender
>>> immediately
>>> and delete it from your system. Thank You.
>>>
>>
>>
>
>
> --
>
>
> https://github.com/bearrito
> @deepbearrito
>

Re: Why "<" doesn't work?

Posted by "j.barrett Strausser" <j....@gmail.com>.
What is the result if you invert them? Meaning multiply by negative 1.


On Thu, Sep 26, 2013 at 3:01 PM, Gary Zhao <ga...@gmail.com> wrote:

> For example,
>
> select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
> eventtime > 1380204000 *and eventtime < 1390218015 *and
> countrycode='US';
>
> Total MapReduce CPU Time Spent: 3 seconds 490 msec
> OK
>
>  select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
> eventtime > 1380204000 and  countrycode='US';
> Total MapReduce CPU Time Spent: 3 seconds 860 msec
> OK
> 32581
>
> eventtime  is  bigint and I'm pretty sure all records are < 1390218015.
>
>
> Thanks
> Gary
>
>
>
> On Thu, Sep 26, 2013 at 11:54 AM, Thejas Nair <th...@hortonworks.com>wrote:
>
>> Can you shares some examples of what does not work ?
>>
>>
>> On Thu, Sep 26, 2013 at 11:34 AM, Gary Zhao <ga...@gmail.com> wrote:
>> > Hello
>> >
>> > I found something strange. I tried a few queries, in WHERE
>> >
>> > 1. ">" works, returns expected results
>> > 2. ">" and "<" doesn't work, returns 0 result
>> > 3. "<" doesn't work, return 0 result
>> > 4. BETWEEN, syntax error
>> >
>> > Basically, I want to find records between to time stamps that are epoch
>> unix
>> > timestamps. Is there anything I did wrong?
>> >
>> > Thanks
>> > Gary
>> >
>>
>> --
>> CONFIDENTIALITY NOTICE
>> NOTICE: This message is intended for the use of the individual or entity
>> to
>> which it is addressed and may contain information that is confidential,
>> privileged and exempt from disclosure under applicable law. If the reader
>> of this message is not the intended recipient, you are hereby notified
>> that
>> any printing, copying, dissemination, distribution, disclosure or
>> forwarding of this communication is strictly prohibited. If you have
>> received this communication in error, please contact the sender
>> immediately
>> and delete it from your system. Thank You.
>>
>
>


-- 


https://github.com/bearrito
@deepbearrito

Re: Why "<" doesn't work?

Posted by Gary Zhao <ga...@gmail.com>.
For example,

select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
eventtime > 1380204000 *and eventtime < 1390218015 *and countrycode='US';

Total MapReduce CPU Time Spent: 3 seconds 490 msec
OK

 select COUNT(*) from firstlaunchafterdownload where ds=20130926 and
eventtime > 1380204000 and  countrycode='US';
Total MapReduce CPU Time Spent: 3 seconds 860 msec
OK
32581

eventtime  is  bigint and I'm pretty sure all records are < 1390218015.


Thanks
Gary



On Thu, Sep 26, 2013 at 11:54 AM, Thejas Nair <th...@hortonworks.com>wrote:

> Can you shares some examples of what does not work ?
>
>
> On Thu, Sep 26, 2013 at 11:34 AM, Gary Zhao <ga...@gmail.com> wrote:
> > Hello
> >
> > I found something strange. I tried a few queries, in WHERE
> >
> > 1. ">" works, returns expected results
> > 2. ">" and "<" doesn't work, returns 0 result
> > 3. "<" doesn't work, return 0 result
> > 4. BETWEEN, syntax error
> >
> > Basically, I want to find records between to time stamps that are epoch
> unix
> > timestamps. Is there anything I did wrong?
> >
> > Thanks
> > Gary
> >
>
> --
> CONFIDENTIALITY NOTICE
> NOTICE: This message is intended for the use of the individual or entity to
> which it is addressed and may contain information that is confidential,
> privileged and exempt from disclosure under applicable law. If the reader
> of this message is not the intended recipient, you are hereby notified that
> any printing, copying, dissemination, distribution, disclosure or
> forwarding of this communication is strictly prohibited. If you have
> received this communication in error, please contact the sender immediately
> and delete it from your system. Thank You.
>

Re: Why "<" doesn't work?

Posted by Thejas Nair <th...@hortonworks.com>.
Can you shares some examples of what does not work ?


On Thu, Sep 26, 2013 at 11:34 AM, Gary Zhao <ga...@gmail.com> wrote:
> Hello
>
> I found something strange. I tried a few queries, in WHERE
>
> 1. ">" works, returns expected results
> 2. ">" and "<" doesn't work, returns 0 result
> 3. "<" doesn't work, return 0 result
> 4. BETWEEN, syntax error
>
> Basically, I want to find records between to time stamps that are epoch unix
> timestamps. Is there anything I did wrong?
>
> Thanks
> Gary
>

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.