Jdbc connection issue

2016-10-05 Thread vikram.kondadasula
Hi,

I am trying to connect to phoenix using jdbc  and getting the following 
exception. However the master is running and I can connect sqlline and hbase 
shell.
The exception is not making any sense  to me.

org.apache.phoenix.exception.PhoenixIOException: Failed after attempts=35, 
exceptions:
Wed Oct 05 14:49:14 EDT 2016, RpcRetryingCaller{globalStartTime=1475693354012, 
pause=100, retries=35}, org.apache.hadoop.hbase.MasterNotRunningException: 
com.google.protobuf.ServiceException: 
org.apache.hadoop.hbase.exceptions.ConnectionClosingException: Call to 
ldnpsr01635.intranet.barcapint.com/10.69.64.176:6 failed on local 
exception: org.apache.hadoop.hbase.exceptions.ConnectionClosingException: 
Connection to ldnpsr01635.intranet.barcapint.com/10.69.64.176:6 is 
closing. Call id=0, waitTime=188

at 
org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:108)
at 
org.apache.phoenix.query.ConnectionQueryServicesImpl.ensureTableCreated(ConnectionQueryServicesImpl.java:889)
at 
org.apache.phoenix.query.ConnectionQueryServicesImpl.createTable(ConnectionQueryServicesImpl.java:1223)
at 
org.apache.phoenix.query.DelegateConnectionQueryServices.createTable(DelegateConnectionQueryServices.java:113)
at 
org.apache.phoenix.schema.MetaDataClient.createTableInternal(MetaDataClient.java:1937)
at 
org.apache.phoenix.schema.MetaDataClient.createTable(MetaDataClient.java:751)
at 
org.apache.phoenix.compile.CreateTableCompiler$2.execute(CreateTableCompiler.java:186)
at 
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:320)
at 
org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:312)
at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
at 
org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:310)
at 
org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1422)
at 
org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:1927)
at 
org.apache.phoenix.query.ConnectionQueryServicesImpl$12.call(ConnectionQueryServicesImpl.java:1896)
at 
org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:77)
at 
org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1896)
at 
org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:180)
at 
org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:132)
at 
org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:151)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:190)
at 
com.barclays.fabric.phoenix.PhoenixDAO.execute(PhoenixDAO.java:27)
at 
com.barclays.fabric.phoenix.FPrivilegedAction.run(FPrivilegedAction.java:15)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at 
com.barclays.fabric.phoenix.ConnectionTest.main(ConnectionTest.java:33)

Vikran

___

This message is for information purposes only, it is not a recommendation, 
advice, offer or solicitation to buy or sell a product or service nor an 
official confirmation of any transaction. It is directed at persons who are 
professionals and is not intended for retail customer use. Intended for 
recipient only. This message is subject to the terms at: 
www.barclays.com/emaildisclaimer.

For important disclosures, please see: 
www.barclays.com/salesandtradingdisclaimer regarding market commentary from 
Barclays Sales and/or Trading, who are active market participants; and in 
respect of Barclays Research, including disclosures relating to specific 
issuers, please see http://publicresearch.barclays.com.

___


Re: where clause on Phoenix view built on Hbase table throws error

2016-10-05 Thread John Leach
Date is a reserved word.

Regards,
John Leach

> On Oct 5, 2016, at 9:39 AM, Ted Yu  wrote:
> 
> Please take a look at 
> phoenix-core/src/it/java/org/apache/phoenix/end2end/ToNumberFunctionIT.java 
> where to_number() is used.
> 
> On Wed, Oct 5, 2016 at 7:34 AM, Mich Talebzadeh  > wrote:
> Thanks John.
> 
> 0: jdbc:phoenix:rhes564:2181> select "Date","volume" from "tsco" where
> "Date" = '1-Apr-08';
> +---+---+
> |   Date|  volume   |
> +---+---+
> | 1-Apr-08  | 49664486  |
> +---+---+
> 1 row selected (0.016 seconds)
> 
> BTW I believe double quotes in enclosing phoenix column names are needed
> for case sensitivity on Hbase?
> 
> 
> Also does Phoenix have type conversion from VARCHAR to integer etc? Is
> there such document
> 
> Regards
> 
> 
> 
> 
> Dr Mich Talebzadeh
> 
> 
> 
> LinkedIn * 
> https://www.linkedin.com/profile/view?id=AAEWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
>  
> 
>   
> >*
> 
> 
> 
> http://talebzadehmich.wordpress.com 
> 
> 
> *Disclaimer:* Use it at your own risk. Any and all responsibility for any
> loss, damage or destruction of data or any other property which may arise
> from relying on this email's technical content is explicitly disclaimed.
> The author will in no case be liable for any monetary damages arising from
> such loss, damage or destruction.
> 
> 
> 
> On 5 October 2016 at 15:24, John Leach  > wrote:
> 
> >
> > Remove the double quotes and try single quote.  Double quotes refers to an
> > identifier…
> >
> > Cheers,
> > John Leach
> >
> > > On Oct 5, 2016, at 9:21 AM, Mich Talebzadeh  > > >
> > wrote:
> > >
> > > Hi,
> > >
> > > I have this Hbase table already populated
> > >
> > > create 'tsco','stock_daily'
> > >
> > > and populated using
> > > $HBASE_HOME/bin/hbase org.apache.hadoop.hbase.mapreduce.ImportTsv
> > > -Dimporttsv.separator=',' -Dimporttsv.columns="HBASE_ROW_KEY,
> > > stock_info:stock,stock_info:ticker,stock_daily:Date,stock_
> > daily:open,stock_daily:high,stock_daily:low,stock_daily:
> > close,stock_daily:volume"
> > > tsco hdfs://rhes564:9000/data/stocks/tsco.csv
> > > This works OK. In Hbase I have
> > >
> > > hbase(main):176:0> scan 'tsco', LIMIT => 1
> > > ROWCOLUMN+CELL
> > > TSCO-1-Apr-08
> > > column=stock_daily:Date, timestamp=1475525222488, value=1-Apr-08
> > > TSCO-1-Apr-08
> > > column=stock_daily:close, timestamp=1475525222488, value=405.25
> > > TSCO-1-Apr-08
> > > column=stock_daily:high, timestamp=1475525222488, value=406.75
> > > TSCO-1-Apr-08
> > > column=stock_daily:low, timestamp=1475525222488, value=379.25
> > > TSCO-1-Apr-08
> > > column=stock_daily:open, timestamp=1475525222488, value=380.00
> > > TSCO-1-Apr-08
> > > column=stock_daily:stock, timestamp=1475525222488, value=TESCO PLC
> > > TSCO-1-Apr-08
> > > column=stock_daily:ticker, timestamp=1475525222488, value=TSCO
> > > TSCO-1-Apr-08
> > > column=stock_daily:volume, timestamp=1475525222488, value=49664486
> > >
> > > In Phoenix I have a view "tsco" created on Hbase table as follows:
> > >
> > > 0: jdbc:phoenix:rhes564:2181> create view "tsco" (PK VARCHAR PRIMARY KEY,
> > > "stock_daily"."Date" VARCHAR, "stock_daily"."close" VARCHAR,
> > > "stock_daily"."high" VARCHAR, "stock_daily"."low" VARCHAR,
> > > "stock_daily"."open" VARCHAR, "stock_daily"."ticker" VARCHAR,
> > > "stock_daily"."stock" VARCHAR, "stock_daily"."volume" VARCHAR)
> > >
> > > So all good.
> > >
> > > This works
> > >
> > > 0: jdbc:phoenix:rhes564:2181> select "Date","volume" from "tsco" limit 2;
> > > +---+---+
> > > |   Date|  volume   |
> > > +---+---+
> > > | 1-Apr-08  | 49664486  |
> > > | 1-Apr-09  | 24877341  |
> > > +---+---+
> > > 2 rows selected (0.011 seconds)
> > >
> > > However, I don't seem to be able to use where clause!
> > >
> > > 0: jdbc:phoenix:rhes564:2181> select "Date","volume" from "tsco" where
> > > "Date" = "1-Apr-08";
> > > Error: ERROR 504 (42703): Undefined column. columnName=1-Apr-08
> > > (state=42703,code=504)
> > > org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703):
> > > Undefined column. columnName=1-Apr-08
> > >
> > > Why does it think a predicate "1-Apr-08" is a column.
> > >
> > > Any ideas?
> > >
> > > Thanks
> > >
> > >
> > >
> > > Dr Mich Talebzadeh
> > >
> > >
> > >
> > > LinkedIn * https://www.linkedin.com/profile/view?id= 
> > > 
> > 

Re: where clause on Phoenix view built on Hbase table throws error

2016-10-05 Thread Ted Yu
Please take a look
at phoenix-core/src/it/java/org/apache/phoenix/end2end/ToNumberFunctionIT.java
where to_number() is used.

On Wed, Oct 5, 2016 at 7:34 AM, Mich Talebzadeh 
wrote:

> Thanks John.
>
> 0: jdbc:phoenix:rhes564:2181> select "Date","volume" from "tsco" where
> "Date" = '1-Apr-08';
> +---+---+
> |   Date|  volume   |
> +---+---+
> | 1-Apr-08  | 49664486  |
> +---+---+
> 1 row selected (0.016 seconds)
>
> BTW I believe double quotes in enclosing phoenix column names are needed
> for case sensitivity on Hbase?
>
>
> Also does Phoenix have type conversion from VARCHAR to integer etc? Is
> there such document
>
> Regards
>
>
>
>
> Dr Mich Talebzadeh
>
>
>
> LinkedIn * https://www.linkedin.com/profile/view?id=
> AAEWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
>  OABUrV8Pw>*
>
>
>
> http://talebzadehmich.wordpress.com
>
>
> *Disclaimer:* Use it at your own risk. Any and all responsibility for any
> loss, damage or destruction of data or any other property which may arise
> from relying on this email's technical content is explicitly disclaimed.
> The author will in no case be liable for any monetary damages arising from
> such loss, damage or destruction.
>
>
>
> On 5 October 2016 at 15:24, John Leach  wrote:
>
> >
> > Remove the double quotes and try single quote.  Double quotes refers to
> an
> > identifier…
> >
> > Cheers,
> > John Leach
> >
> > > On Oct 5, 2016, at 9:21 AM, Mich Talebzadeh  >
> > wrote:
> > >
> > > Hi,
> > >
> > > I have this Hbase table already populated
> > >
> > > create 'tsco','stock_daily'
> > >
> > > and populated using
> > > $HBASE_HOME/bin/hbase org.apache.hadoop.hbase.mapreduce.ImportTsv
> > > -Dimporttsv.separator=',' -Dimporttsv.columns="HBASE_ROW_KEY,
> > > stock_info:stock,stock_info:ticker,stock_daily:Date,stock_
> > daily:open,stock_daily:high,stock_daily:low,stock_daily:
> > close,stock_daily:volume"
> > > tsco hdfs://rhes564:9000/data/stocks/tsco.csv
> > > This works OK. In Hbase I have
> > >
> > > hbase(main):176:0> scan 'tsco', LIMIT => 1
> > > ROWCOLUMN+CELL
> > > TSCO-1-Apr-08
> > > column=stock_daily:Date, timestamp=1475525222488, value=1-Apr-08
> > > TSCO-1-Apr-08
> > > column=stock_daily:close, timestamp=1475525222488, value=405.25
> > > TSCO-1-Apr-08
> > > column=stock_daily:high, timestamp=1475525222488, value=406.75
> > > TSCO-1-Apr-08
> > > column=stock_daily:low, timestamp=1475525222488, value=379.25
> > > TSCO-1-Apr-08
> > > column=stock_daily:open, timestamp=1475525222488, value=380.00
> > > TSCO-1-Apr-08
> > > column=stock_daily:stock, timestamp=1475525222488, value=TESCO PLC
> > > TSCO-1-Apr-08
> > > column=stock_daily:ticker, timestamp=1475525222488, value=TSCO
> > > TSCO-1-Apr-08
> > > column=stock_daily:volume, timestamp=1475525222488, value=49664486
> > >
> > > In Phoenix I have a view "tsco" created on Hbase table as follows:
> > >
> > > 0: jdbc:phoenix:rhes564:2181> create view "tsco" (PK VARCHAR PRIMARY
> KEY,
> > > "stock_daily"."Date" VARCHAR, "stock_daily"."close" VARCHAR,
> > > "stock_daily"."high" VARCHAR, "stock_daily"."low" VARCHAR,
> > > "stock_daily"."open" VARCHAR, "stock_daily"."ticker" VARCHAR,
> > > "stock_daily"."stock" VARCHAR, "stock_daily"."volume" VARCHAR)
> > >
> > > So all good.
> > >
> > > This works
> > >
> > > 0: jdbc:phoenix:rhes564:2181> select "Date","volume" from "tsco" limit
> 2;
> > > +---+---+
> > > |   Date|  volume   |
> > > +---+---+
> > > | 1-Apr-08  | 49664486  |
> > > | 1-Apr-09  | 24877341  |
> > > +---+---+
> > > 2 rows selected (0.011 seconds)
> > >
> > > However, I don't seem to be able to use where clause!
> > >
> > > 0: jdbc:phoenix:rhes564:2181> select "Date","volume" from "tsco" where
> > > "Date" = "1-Apr-08";
> > > Error: ERROR 504 (42703): Undefined column. columnName=1-Apr-08
> > > (state=42703,code=504)
> > > org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703):
> > > Undefined column. columnName=1-Apr-08
> > >
> > > Why does it think a predicate "1-Apr-08" is a column.
> > >
> > > Any ideas?
> > >
> > > Thanks
> > >
> > >
> > >
> > > Dr Mich Talebzadeh
> > >
> > >
> > >
> > > LinkedIn * https://www.linkedin.com/profile/view?id=
> > AAEWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
> > >  AAEWh2gBxianrbJd6zP6AcPCCd
> > OABUrV8Pw>*
> > >
> > >
> > >
> > > http://talebzadehmich.wordpress.com
> > >
> > >
> > > *Disclaimer:* Use it at your own risk. Any and all responsibility for
> any
> > > loss, damage or destruction of data or any other property which may
> arise
> > > from relying on this email's technical content is explicitly
> disclaimed.
> > > The author will in no case be liable for any monetary damages arising
> > from
> > > such 

Re: where clause on Phoenix view built on Hbase table throws error

2016-10-05 Thread Ted Yu
I think phoenix mailing list is the proper one for this thread.

On Wed, Oct 5, 2016 at 7:24 AM, John Leach  wrote:

>
> Remove the double quotes and try single quote.  Double quotes refers to an
> identifier…
>
> Cheers,
> John Leach
>
> > On Oct 5, 2016, at 9:21 AM, Mich Talebzadeh 
> wrote:
> >
> > Hi,
> >
> > I have this Hbase table already populated
> >
> > create 'tsco','stock_daily'
> >
> > and populated using
> > $HBASE_HOME/bin/hbase org.apache.hadoop.hbase.mapreduce.ImportTsv
> > -Dimporttsv.separator=',' -Dimporttsv.columns="HBASE_ROW_KEY,
> > stock_info:stock,stock_info:ticker,stock_daily:Date,stock_
> daily:open,stock_daily:high,stock_daily:low,stock_daily:
> close,stock_daily:volume"
> > tsco hdfs://rhes564:9000/data/stocks/tsco.csv
> > This works OK. In Hbase I have
> >
> > hbase(main):176:0> scan 'tsco', LIMIT => 1
> > ROWCOLUMN+CELL
> > TSCO-1-Apr-08
> > column=stock_daily:Date, timestamp=1475525222488, value=1-Apr-08
> > TSCO-1-Apr-08
> > column=stock_daily:close, timestamp=1475525222488, value=405.25
> > TSCO-1-Apr-08
> > column=stock_daily:high, timestamp=1475525222488, value=406.75
> > TSCO-1-Apr-08
> > column=stock_daily:low, timestamp=1475525222488, value=379.25
> > TSCO-1-Apr-08
> > column=stock_daily:open, timestamp=1475525222488, value=380.00
> > TSCO-1-Apr-08
> > column=stock_daily:stock, timestamp=1475525222488, value=TESCO PLC
> > TSCO-1-Apr-08
> > column=stock_daily:ticker, timestamp=1475525222488, value=TSCO
> > TSCO-1-Apr-08
> > column=stock_daily:volume, timestamp=1475525222488, value=49664486
> >
> > In Phoenix I have a view "tsco" created on Hbase table as follows:
> >
> > 0: jdbc:phoenix:rhes564:2181> create view "tsco" (PK VARCHAR PRIMARY KEY,
> > "stock_daily"."Date" VARCHAR, "stock_daily"."close" VARCHAR,
> > "stock_daily"."high" VARCHAR, "stock_daily"."low" VARCHAR,
> > "stock_daily"."open" VARCHAR, "stock_daily"."ticker" VARCHAR,
> > "stock_daily"."stock" VARCHAR, "stock_daily"."volume" VARCHAR)
> >
> > So all good.
> >
> > This works
> >
> > 0: jdbc:phoenix:rhes564:2181> select "Date","volume" from "tsco" limit 2;
> > +---+---+
> > |   Date|  volume   |
> > +---+---+
> > | 1-Apr-08  | 49664486  |
> > | 1-Apr-09  | 24877341  |
> > +---+---+
> > 2 rows selected (0.011 seconds)
> >
> > However, I don't seem to be able to use where clause!
> >
> > 0: jdbc:phoenix:rhes564:2181> select "Date","volume" from "tsco" where
> > "Date" = "1-Apr-08";
> > Error: ERROR 504 (42703): Undefined column. columnName=1-Apr-08
> > (state=42703,code=504)
> > org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703):
> > Undefined column. columnName=1-Apr-08
> >
> > Why does it think a predicate "1-Apr-08" is a column.
> >
> > Any ideas?
> >
> > Thanks
> >
> >
> >
> > Dr Mich Talebzadeh
> >
> >
> >
> > LinkedIn * https://www.linkedin.com/profile/view?id=
> AAEWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw
> >  OABUrV8Pw>*
> >
> >
> >
> > http://talebzadehmich.wordpress.com
> >
> >
> > *Disclaimer:* Use it at your own risk. Any and all responsibility for any
> > loss, damage or destruction of data or any other property which may arise
> > from relying on this email's technical content is explicitly disclaimed.
> > The author will in no case be liable for any monetary damages arising
> from
> > such loss, damage or destruction.
>
>