1

I have application with 2 columns viz. city, category. I want to fit this in hypertable.

There is also id which I would like to add as ROW.

create table ads (city, category);

insert into ads values ("1", "city:mumbai", "1");
insert into ads values ("1", "category:cars", "1");
insert into ads values ("2", "city:pune", "1");
insert into ads values ("2", "category:bikes", "1");

My question is how do I fetch rows where city = mumbai which should fetch 2 rows of ROW = 1.

So suppose I would make similar query in MySQL..

select * from ads where city = "mumbai"; 

I will get 1 row having category=cars, city=mumbai and id=1..How can same be achived in hypertable query?

Thanks.

Rahul
  • 1,403
  • 4
  • 18
  • 31

1 Answers1

0

it seems to be a current limitation as writed in: http://hypertable.com/documentation/reference_manual/hql/#select
when you query for column you can get as results only the column values.
they say:

(these limitations will be removed in future versions of Hypertable)

Column Value Predicate

When specifying a column value predicate, the column family must be identical to the column family used in the SELECT clause, and exactly one column family must be selected. The following examples are valid:

 SELECT col FROM test WHERE col = "foo";
 SELECT col FROM test WHERE col =^ "prefix";

The following examples are not valid because they select more than one column family or because the column family in the select clause is different from the one in the predicate (these limitations will be removed in future versions of Hypertable):

SELECT * FROM test WHERE col = "foo";
SELECT col, col2 FROM test WHERE col =^ "prefix";
SELECT foo FROM test WHERE bar = "value";
ygaradon
  • 2,198
  • 2
  • 21
  • 27