对hbase 1.1.2使用apachephoenix 4.6.0。
我创建了一个简单的表,如下所示:
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
这些查询起作用:
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')
但这个不是:
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');
错误:错误502(42702):列引用不明确或名称重复。columnname=name sqlstate:42702错误代码:502
为什么?
1条答案
按热度按时间cxfofazt1#
尝试
count(1)
在一个不起作用的地方。很明显,你在给表格加别名,但也许背景中有什么事情发生了,星号没有使用别名。