Live aggregation with legacy table
I am trying to use count(*) in one of the projection's columns. Always getting "Cannot create... : no suitable anchor projection).
All the examples that I've been able to find are using count(column_name). In my case there are no numeric type columns in the table...
Here is what I tried:
-- Original query:
SELECT id, timestamp, count(*) as n from original_table; -- OK, but I want a projection
-- Creating anchor projection as per documentation:
CREATE PROJECTION original_table_a as select id, timestamp, 0 as n from original_table;
SELECT REFRESH(original_table);
SELECT MARK_DESIGN_KSAFE(0); -- I have a single node
-- Creating my target LAP:
CREATE PROJECTION original_table_lap
AS SELECT id, timestamp, count(*) as n from original_table
GROUP BY id, timestamp;
At this point I'm getting the "... no suitable anchor projection"
Any suggestions?
Comments
Are you missing a GROUP BY in your original statement?
Yes, that's a typo. There is a group by id, timestamp there...
BTW, the anchor projection works and I am able to get the info from it, but I want to create a target projection that will have this count(*) as n column and am unable to do that due to "no suitable anchor"...
For some reason, Vertica doesn't like "timestamp" for a column name with Live Aggregate Projections:
Thanks!