Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 57837200B99 for ; Wed, 5 Oct 2016 19:09:20 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 561CA160ADE; Wed, 5 Oct 2016 17:09:20 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 93F57160AC9 for ; Wed, 5 Oct 2016 19:09:19 +0200 (CEST) Received: (qmail 97846 invoked by uid 500); 5 Oct 2016 17:09:10 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 97795 invoked by uid 99); 5 Oct 2016 17:09:09 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2016 17:09:09 +0000 Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id B9D811A0118 for ; Wed, 5 Oct 2016 17:09:08 +0000 (UTC) Received: by mail-wm0-f51.google.com with SMTP id p138so285514450wmb.1 for ; Wed, 05 Oct 2016 10:09:08 -0700 (PDT) X-Gm-Message-State: AA6/9RltcQSxNED4QTVZIbLuNhRESeTBG9lJ23qTNRYODB5hu0ivsMbvCsx/hobemvwlZ/t1ASqFgXwpY2xOUg== X-Received: by 10.194.78.227 with SMTP id e3mr8444620wjx.195.1475687347330; Wed, 05 Oct 2016 10:09:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.178.100 with HTTP; Wed, 5 Oct 2016 10:08:27 -0700 (PDT) In-Reply-To: References: <64C1D324-B206-46DF-945E-CA77414149B2@splicemachine.com> From: Dima Spivak Date: Wed, 5 Oct 2016 10:08:27 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: where clause on Phoenix view built on Hbase table throws error To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=047d7bfcf00623426e053e213ca9 archived-at: Wed, 05 Oct 2016 17:09:20 -0000 --047d7bfcf00623426e053e213ca9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I think you might have better luck with Phoenix questions on the Phoenix user mailing list. :) -Dima 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" =3D '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=3DAAEAAAAWh2gBxianrbJ > d6zP6AcPCCdOABUrV8Pw > Jd6zP6AcPCCdOABUrV8Pw>* > > > > 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 fro= m > 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=E2=80=A6 > > > > 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=3D',' -Dimporttsv.columns=3D"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 =3D> 1 > > > ROW COLUMN+CELL > > > TSCO-1-Apr-08 > > > column=3Dstock_daily:Date, timestamp=3D1475525222488, value=3D1-Apr-0= 8 > > > TSCO-1-Apr-08 > > > column=3Dstock_daily:close, timestamp=3D1475525222488, value=3D405.25 > > > TSCO-1-Apr-08 > > > column=3Dstock_daily:high, timestamp=3D1475525222488, value=3D406.75 > > > TSCO-1-Apr-08 > > > column=3Dstock_daily:low, timestamp=3D1475525222488, value=3D379.25 > > > TSCO-1-Apr-08 > > > column=3Dstock_daily:open, timestamp=3D1475525222488, value=3D380.00 > > > TSCO-1-Apr-08 > > > column=3Dstock_daily:stock, timestamp=3D1475525222488, value=3DTESCO = PLC > > > TSCO-1-Apr-08 > > > column=3Dstock_daily:ticker, timestamp=3D1475525222488, value=3DTSCO > > > TSCO-1-Apr-08 > > > column=3Dstock_daily:volume, timestamp=3D1475525222488, value=3D49664= 486 > > > > > > 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" limi= t > 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" wher= e > > > "Date" =3D "1-Apr-08"; > > > Error: ERROR 504 (42703): Undefined column. columnName=3D1-Apr-08 > > > (state=3D42703,code=3D504) > > > org.apache.phoenix.schema.ColumnNotFoundException: ERROR 504 (42703): > > > Undefined column. columnName=3D1-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=3D > > AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw > > > Jd6zP6AcPCCd > > 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. > > > > > --047d7bfcf00623426e053e213ca9--