Date is a reserved word. Regards, John Leach
> On Oct 5, 2016, at 9:39 AM, Ted Yu <yuzhih...@gmail.com> 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 <mich.talebza...@gmail.com > <mailto:mich.talebza...@gmail.com>> 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=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw > > <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw> > <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw > > <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw>>* > > > > http://talebzadehmich.wordpress.com <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 <jle...@splicemachine.com > <mailto:jle...@splicemachine.com>> 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 <mich.talebza...@gmail.com > > > <mailto:mich.talebza...@gmail.com>> > > 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 > > > ROW COLUMN+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= > > > <https://www.linkedin.com/profile/view?id=> > > AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw > > > <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCd > > > <https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCd> > > OABUrV8Pw>* > > > > > > > > > > > > http://talebzadehmich.wordpress.com <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. > > > > >