Gaurav Swaroop
Gaurav Swaroop

Reputation: 31

Primay key in Phoenix returns Null when decleared as bigint

I am using Phoenix to run SQL on my HBase, but when I try bigint for primary key it returns NULL for that columns in select but varchar return correct result

Upvotes: 1

Views: 155

Answers (1)

Anish Nair
Anish Nair

Reputation: 79

This is plainly because the primary key in Hbase/Phoenix is stored as an integer, which by definition can be 0,1,-1. If it is 0, it is nullable which a primary key cannot be. Hence, we need to keep it as a VARCHAR.

Upvotes: 1

Related Questions