Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Phoenix Primary Key

Phoenix Primary Key

Contributor

One of our customer struggling Phoenix dropping some Characters on what is especially a Primary Key. For some reason when they write to Phoenix its dropping a leading character and they can’t seem to figure out why.

7 REPLIES 7
Highlighted

Re: Phoenix Primary Key

Mentor

Please post logs.

Highlighted

Re: Phoenix Primary Key

Explorer

Please find attached the logs .

Highlighted

Re: Phoenix Primary Key

@Maharaj Muthusamy I notice your table has 6 columns but your select output has 7 columns. Is this just a oversight when creating the document? I'm not suggesting it has anything to do with the error.

Highlighted

Re: Phoenix Primary Key

Explorer

patient-phoenix-primary-key-bigint.txtPlease find attached another example where we have defined primary key as bigint. We are seeing negative values in phoenix table.

Highlighted

Re: Phoenix Primary Key

Expert Contributor

FYI, The integer, bigint data types in Phoenix flip the sign bit. Weird design choice! From the Phoenix docs:

"The binary representation is an 8 byte long with the sign bit flipped (so that negative values sorts before positive values)."

Highlighted

Re: Phoenix Primary Key

Explorer

Scott

In the select output 123, USA is the value in add_line_1 . I think it appears like two columns in the output. The select output has only 7 columns.

Highlighted

Re: Phoenix Primary Key

Mentor

I think you're issue is that you're using bigint in Hive mapped to Phoenix bigint whereas in Phoenix you should map to unsigned_long instead. It should be an easy test, just test by changing your Pat_ID to unsigned_long. https://phoenix.apache.org/language/datatypes.html

Don't have an account?
Coming from Hortonworks? Activate your account here