Re: Division by floating number literal in hive 2.3.5 results in implicit conversion to integer

2020-04-27 Thread Kwanghee Park
SELECT CAST(1.0 AS DOUBLE)/2.0 FROM EXAMPLE;
SELECT DOUBLE(1.0)/2.0 FROM EXAMPLE;

On Tue, Apr 28, 2020 at 5:31 AM Arup Malakar  wrote:

>
> Would anyone know if it could be related to calcite versions and any
> possible workarounds?
>
> On Thu, Apr 23, 2020 at 6:16 PM Arup Malakar  wrote:
>
>> Hi Hive Users,
>>
>> I noticed that with cbo on the query: "SELECT 1.0/2.0 FROM example limit
>> 1" returns 0
>>
>> hive> SET hive.cbo.enable=true; SELECT 1.0/2.0 FROM example limit 1;
>>> 0
>>>
>>
>>
>> With cbo disabled it returns 0.5 as expected:
>>
>> hive> SET hive.cbo.enable=false; SELECT 1.0/2.0 FROM example limit 1;
>>> 0.5
>>>
>>
>> Not referring to a table returns 0.5 as expected as well:
>>
>> hive> select 1.0/2.0;
>>> 0.5
>>>
>>
>>
>> This is how the explain plan looks like:
>>
>> hive> SET hive.cbo.enable=true; EXPLAIN extended SELECT 1.0/2.0 FROM
>>> example limit 1;
>>> OK
>>> STAGE DEPENDENCIES:
>>>   Stage-0 is a root stage
>>> STAGE PLANS:
>>>   Stage: Stage-0
>>> Fetch Operator
>>>   limit: 1
>>>   Processor Tree:
>>> TableScan
>>>   alias: example
>>>   GatherStats: false
>>>   Select Operator
>>> expressions: 0 (type: int)
>>> outputColumnNames: _col0
>>> Limit
>>>   Number of rows: 1
>>>   ListSink
>>
>>
>> I have tested that it is not an issue in 2.1.1 and 3.0, but only in
>> 2.3.6. I couldn't find a corresponding JIRA that fixes it though. Does
>> anyone know if there is a JIRA that fixes this (so that I can backport) or
>> any other suggestion?
>>
>> --
>> Arup Malakar
>>
>
>
> --
> Arup Malakar
>


Re: Division by floating number literal in hive 2.3.5 results in implicit conversion to integer

2020-04-27 Thread Kwanghee Park
SELECT DOUBLE(1.0/2.0) FROM EXAMPLE;

On Tue, Apr 28, 2020 at 2:36 PM Kwanghee Park  wrote:

> SELECT CAST(1.0 AS DOUBLE)/2.0 FROM EXAMPLE;
> SELECT DOUBLE(1.0)/2.0 FROM EXAMPLE;
>
> On Tue, Apr 28, 2020 at 5:31 AM Arup Malakar  wrote:
>
>>
>> Would anyone know if it could be related to calcite versions and any
>> possible workarounds?
>>
>> On Thu, Apr 23, 2020 at 6:16 PM Arup Malakar  wrote:
>>
>>> Hi Hive Users,
>>>
>>> I noticed that with cbo on the query: "SELECT 1.0/2.0 FROM example limit
>>> 1" returns 0
>>>
>>> hive> SET hive.cbo.enable=true; SELECT 1.0/2.0 FROM example limit 1;
 0

>>>
>>>
>>> With cbo disabled it returns 0.5 as expected:
>>>
>>> hive> SET hive.cbo.enable=false; SELECT 1.0/2.0 FROM example limit 1;
 0.5

>>>
>>> Not referring to a table returns 0.5 as expected as well:
>>>
>>> hive> select 1.0/2.0;
 0.5

>>>
>>>
>>> This is how the explain plan looks like:
>>>
>>> hive> SET hive.cbo.enable=true; EXPLAIN extended SELECT 1.0/2.0 FROM
 example limit 1;
 OK
 STAGE DEPENDENCIES:
   Stage-0 is a root stage
 STAGE PLANS:
   Stage: Stage-0
 Fetch Operator
   limit: 1
   Processor Tree:
 TableScan
   alias: example
   GatherStats: false
   Select Operator
 expressions: 0 (type: int)
 outputColumnNames: _col0
 Limit
   Number of rows: 1
   ListSink
>>>
>>>
>>> I have tested that it is not an issue in 2.1.1 and 3.0, but only in
>>> 2.3.6. I couldn't find a corresponding JIRA that fixes it though. Does
>>> anyone know if there is a JIRA that fixes this (so that I can backport) or
>>> any other suggestion?
>>>
>>> --
>>> Arup Malakar
>>>
>>
>>
>> --
>> Arup Malakar
>>
>


Count bug in Hive 3.0.0.3.1

2020-04-27 Thread Deepak Krishna
Hi team,

We came across a bug related to count function. We are using hive 3.0.0.3.1 
with Tez 0.9.0.3.1. PFA the queries to replicate the issue.

Please register this as a bug and let us know if we can support in anyway to 
fix the issue. It would also be helpful to know if there are any other 
workarounds for this issue.

Thanks and Regards,
Deepak Krishna





Deepak Krishna
Big Data Engineer

[Tel.]
[Fax]   +49 721 98993-
[E-Mail]hs-d...@solute.de


solute GmbH
Zeppelinstraße 15
76185 Karlsruhe
Germany


[Logo Solute]

Marken der solute GmbH | brands of solute GmbH
[Marken]

Geschäftsführer | Managing Director: Dr. Thilo Gans, Bernd Vermaaten
Webseite | www.solute.de 
Sitz | Registered Office: Karlsruhe
Registergericht | Register Court: Amtsgericht Mannheim
Registernummer | Register No.: HRB 110579
USt-ID | VAT ID: DE234663798



Informationen zum Datenschutz | Information about privacy policy
https://www.solute.de/ger/datenschutz/grundsaetze-der-datenverarbeitung.php





count_bug.sql
Description: count_bug.sql


Re: Request write access to the Hive wiki

2020-04-27 Thread Jiajie Zhong
Ping again.
Did someone could grant permission to me to change the HIVE wiki?

Best Wish
— Jiajie



> On Apr 25, 2020, at 18:29, Jiajie Zhong  wrote:
> 
> Hi folks,
> 
> I reading HIVE doc and find some death link to it,
> I want to update it so request write access to the Hive wiki
> My confluence name is
> 
> Jiajie Zhong
> 
> Could someone grant permission to me, Thx
> 
> 
> Best Wish
> — Jiajie
> 



Re: Division by floating number literal in hive 2.3.5 results in implicit conversion to integer

2020-04-27 Thread Arup Malakar
Would anyone know if it could be related to calcite versions and any
possible workarounds?

On Thu, Apr 23, 2020 at 6:16 PM Arup Malakar  wrote:

> Hi Hive Users,
>
> I noticed that with cbo on the query: "SELECT 1.0/2.0 FROM example limit
> 1" returns 0
>
> hive> SET hive.cbo.enable=true; SELECT 1.0/2.0 FROM example limit 1;
>> 0
>>
>
>
> With cbo disabled it returns 0.5 as expected:
>
> hive> SET hive.cbo.enable=false; SELECT 1.0/2.0 FROM example limit 1;
>> 0.5
>>
>
> Not referring to a table returns 0.5 as expected as well:
>
> hive> select 1.0/2.0;
>> 0.5
>>
>
>
> This is how the explain plan looks like:
>
> hive> SET hive.cbo.enable=true; EXPLAIN extended SELECT 1.0/2.0 FROM
>> example limit 1;
>> OK
>> STAGE DEPENDENCIES:
>>   Stage-0 is a root stage
>> STAGE PLANS:
>>   Stage: Stage-0
>> Fetch Operator
>>   limit: 1
>>   Processor Tree:
>> TableScan
>>   alias: example
>>   GatherStats: false
>>   Select Operator
>> expressions: 0 (type: int)
>> outputColumnNames: _col0
>> Limit
>>   Number of rows: 1
>>   ListSink
>
>
> I have tested that it is not an issue in 2.1.1 and 3.0, but only in 2.3.6.
> I couldn't find a corresponding JIRA that fixes it though. Does anyone know
> if there is a JIRA that fixes this (so that I can backport) or any other
> suggestion?
>
> --
> Arup Malakar
>


-- 
Arup Malakar