3

Using Apache Phoenix 4.6.0 against HBase 1.1.2.

I have a simple table created like this:

CREATE TABLE "events" (
"uuid" VARCHAR(64) PRIMARY KEY,
"event"."session" VARCHAR(64),
"event"."name" VARCHAR(32),
"event"."date" UNSIGNED_DATE,
"product"."name" VARCHAR(32),
"data"."*" VARCHAR(64)
) default_column_family='event', IMMUTABLE_ROWS=true

These queries works:

SELECT COUNT(*) FROM "events" AS search WHERE search."event"."name" = 'search'

SELECT COUNT(*) FROM 
(SELECT click."event"."session" 
FROM "events" AS click WHERE "event"."name" = 'click')

But this one not:

SELECT COUNT(*) FROM "events" AS search 
WHERE search."event"."name" = 'search' 
AND search."event"."session" NOT IN (SELECT click."event"."session" 
FROM "events" AS click 
WHERE click."event"."name" = 'click');

Error: ERROR 502 (42702): Column reference ambiguous or duplicate names. columnName=name SQLState: 42702 ErrorCode: 502

Why?

Thomas Decaux
  • 21,738
  • 2
  • 113
  • 124
  • to get your answer you have to first send email dev-subscribe@phoenix.apache.org to subscribe to their emailing list and once you are confirmed in that emailing group then send email to dev@phoenix.apache.org. – Mohammad Adnan Mar 02 '16 at 11:54

1 Answers1

0

Try count(1) on the one that doesn't work. You're clearly aliasing the tables, but maybe something is going on in the background with the asterisk that is not using the aliases.

cribbage
  • 11
  • 3