Re: can I prevent rounding of a/b when a and b are integers

2016-09-21 Thread James Taylor
Hi Noam,
Please file a JIRA. As a workaround, you can do SELECT 1.0/3.
Thanks,
James

On Wed, Sep 21, 2016 at 12:48 AM, Bulvik, Noam 
wrote:

> Hi,
>
>
>
> When I do something like select 1/3 from   the result will be
> integer value (0) and not double or alike(0.33….). Is there some
> configuration that can force the result to be double
>
>
>
> BTW – when executing the same query in oracle (select 1/3 from dual ) I
> get correct result same in impala
>
>
>
> *Noam Bulvik*
>
>
>
> --
>
> PRIVILEGED AND CONFIDENTIAL
> PLEASE NOTE: The information contained in this message is privileged and
> confidential, and is intended only for the use of the individual to whom it
> is addressed and others who have been specifically authorized to receive
> it. If you are not the intended recipient, you are hereby notified that any
> dissemination, distribution or copying of this communication is strictly
> prohibited. If you have received this communication in error, or if any
> problems occur with transmission, please contact sender. Thank you.
>


Re: can I prevent rounding of a/b when a and b are integers

2016-09-21 Thread Ankit Singhal
Adding some more workaround , if you are working on column:-
select cast(col_int1 as decimal)/col_int2;
select col_int1*1.0/3;



On Wed, Sep 21, 2016 at 8:33 PM, James Taylor 
wrote:

> Hi Noam,
> Please file a JIRA. As a workaround, you can do SELECT 1.0/3.
> Thanks,
> James
>
> On Wed, Sep 21, 2016 at 12:48 AM, Bulvik, Noam 
> wrote:
>
>> Hi,
>>
>>
>>
>> When I do something like select 1/3 from   the result will be
>> integer value (0) and not double or alike(0.33….). Is there some
>> configuration that can force the result to be double
>>
>>
>>
>> BTW – when executing the same query in oracle (select 1/3 from dual ) I
>> get correct result same in impala
>>
>>
>>
>> *Noam Bulvik*
>>
>>
>>
>> --
>>
>> PRIVILEGED AND CONFIDENTIAL
>> PLEASE NOTE: The information contained in this message is privileged and
>> confidential, and is intended only for the use of the individual to whom it
>> is addressed and others who have been specifically authorized to receive
>> it. If you are not the intended recipient, you are hereby notified that any
>> dissemination, distribution or copying of this communication is strictly
>> prohibited. If you have received this communication in error, or if any
>> problems occur with transmission, please contact sender. Thank you.
>>
>
>


Phoenix ResultSet.next() takes a long time for first row

2016-09-21 Thread Sasikumar Natarajan
Hi,
I'm using Apache Phoenix core 4.4.0-HBase-1.1 library to query the data
available on Phoenix server.

preparedStatement.executeQuery()  seems to be taking less time. But to
enter into *while (rs.next()) {} *takes a long time. I would like to know
what is causing the delay to make the ResultSet ready. Please share your
thoughts on this.


-- 
Regards,
Sasikumar Natarajan


Re: property object is being modified

2016-09-21 Thread Josh Elser
Sounds like the thin driver should be making a copy of the properties if 
its going to be modifying it. Want to open a JIRA issue?


Prabhjyot Singh wrote:

Hi,

I'm using DriverManager.getConnection(url, properties) using following
properties

url ->
"jdbc:phoenix:thin:url=http://prabhu-3.novalocal:8765;serialization=PROTOBUF;

properties ->
0 = {java.util.Hashtable$Entry@1491} "user" -> "phoenixuser"
1 = {java.util.Hashtable$Entry@1492} "password" ->
2 = {java.util.Hashtable$Entry@1493} "url" ->
"jdbc:phoenix:thin:url=http://prabhu-3.novalocal:8765;serialization=PROTOBUF;
3 = {java.util.Hashtable$Entry@1494} "hbase.client.retries.number" -> "4"
4 = {java.util.Hashtable$Entry@1495} "driver" ->
"org.apache.phoenix.jdbc.PhoenixDriver"

With the above propert/setting/config it returns a connection to the URL
specified, but it also modifies my properties object to following

properties ->
0 = {java.util.Hashtable$Entry@2361} "serialization" -> "PROTOBUF"
1 = {java.util.Hashtable$Entry@2362} "user" -> "phoenixuser"
2 = {java.util.Hashtable$Entry@2363} "password" ->
*3 = {java.util.Hashtable$Entry@2364} "url" ->
"http://prabhu-3.novalocal:8765"*
4 = {java.util.Hashtable$Entry@2365} "hbase.client.retries.number" -> "4"
5 = {java.util.Hashtable$Entry@2366} "driver" ->
"org.apache.phoenix.jdbc.PhoenixDriver"


The above only happens if I'm using *thin-client*. Is this the expected
behaviour ?

I plan to use this "properties" object after getting the connection for
something else.
Also, I'm using following in my maven dependency
"org.apache.phoenix:phoenix-server-client:4.7.0-HBase-1.1"





--
Warm Regards,

-- Prabhjyot Singh


can I prevent rounding of a/b when a and b are integers

2016-09-21 Thread Bulvik, Noam
Hi,

When I do something like select 1/3 from   the result will be integer 
value (0) and not double or alike(0.33). Is there some configuration that 
can force the result to be double

BTW - when executing the same query in oracle (select 1/3 from dual ) I get 
correct result same in impala

Noam Bulvik




PRIVILEGED AND CONFIDENTIAL
PLEASE NOTE: The information contained in this message is privileged and 
confidential, and is intended only for the use of the individual to whom it is 
addressed and others who have been specifically authorized to receive it. If 
you are not the intended recipient, you are hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, or if any 
problems occur with transmission, please contact sender. Thank you.


RE: can I prevent rounding of a/b when a and b are integers

2016-09-21 Thread Bulvik, Noam
Thanks for the workaround , but it is not a solution for our case. We have an 
app that let user write their own SQL and we can’t tell them to always write 
int numbers as xxx.0

I created  https://issues.apache.org/jira/browse/PHOENIX-3312

Regards,
Noam



From: James Taylor [mailto:jamestay...@apache.org]
Sent: Wednesday, September 21, 2016 6:03 PM
To: user 
Subject: Re: can I prevent rounding of a/b when a and b are integers

Hi Noam,
Please file a JIRA. As a workaround, you can do SELECT 1.0/3.
Thanks,
James

On Wed, Sep 21, 2016 at 12:48 AM, Bulvik, Noam 
> wrote:
Hi,

When I do something like select 1/3 from   the result will be integer 
value (0) and not double or alike(0.33….). Is there some configuration that can 
force the result to be double

BTW – when executing the same query in oracle (select 1/3 from dual ) I get 
correct result same in impala

Noam Bulvik




PRIVILEGED AND CONFIDENTIAL
PLEASE NOTE: The information contained in this message is privileged and 
confidential, and is intended only for the use of the individual to whom it is 
addressed and others who have been specifically authorized to receive it. If 
you are not the intended recipient, you are hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, or if any 
problems occur with transmission, please contact sender. Thank you.




PRIVILEGED AND CONFIDENTIAL
PLEASE NOTE: The information contained in this message is privileged and 
confidential, and is intended only for the use of the individual to whom it is 
addressed and others who have been specifically authorized to receive it. If 
you are not the intended recipient, you are hereby notified that any 
dissemination, distribution or copying of this communication is strictly 
prohibited. If you have received this communication in error, or if any 
problems occur with transmission, please contact sender. Thank you.