Support Questions
Find answers, ask questions, and share your expertise

Do secondary indexes require that all rows have values for the indexed column?

Can I add a secondary index to a dynamic column defined as part of a view?

1 ACCEPTED SOLUTION

Accepted Solutions

Two questions.

1) Yes if data is upsert via Phoenix. HBase does not store null values in cells, however, Phoenix enters some dummy/empty values in order to be able to select all rows associated with a column. There was a bug couple years that was fixed: PHOENIX-63.

2) No. Even dynamic columns are defined after the table in the FROM clause on a SELECT statement, they are just encoded binary and only understood at the runtime. Indexes are populated on CREATE INDEX on explicit columns. You could get creative by using a virtual column, but that would require more storage and some tricks on the actual SQL and performance may be bad.

View solution in original post

1 REPLY 1

Two questions.

1) Yes if data is upsert via Phoenix. HBase does not store null values in cells, however, Phoenix enters some dummy/empty values in order to be able to select all rows associated with a column. There was a bug couple years that was fixed: PHOENIX-63.

2) No. Even dynamic columns are defined after the table in the FROM clause on a SELECT statement, they are just encoded binary and only understood at the runtime. Indexes are populated on CREATE INDEX on explicit columns. You could get creative by using a virtual column, but that would require more storage and some tricks on the actual SQL and performance may be bad.

View solution in original post