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 INDEX Column Sort in DESC Order

Phoenix INDEX Column Sort in DESC Order

New Contributor

I have created an INDEX on my tables using below DDL:

CREATE INDEX my_index ON my_table (col1, col2, col3 , EVENT DESC) INCLUDE (col4 , col5);

However the EVENT column is not sorted in descending order. Is there anything I am missing? Have I created the Index correctly?

One thing I wanted to highlight was my EVENT column datatype is VARCHAR....is that making EVENT column not to sort?

1 REPLY 1

Re: Phoenix INDEX Column Sort in DESC Order

bq. One thing I wanted to highlight was my EVENT column datatype is VARCHAR....is that making EVENT column not to sort?

Varchar field is also expected to be sorted in desc as like for other data types.

Your "desc" declaration for Event column will be visible only when there are records having the same value for col1,col2,col3.

you can order your keys as per your query pattern or create an additional index with a new order.