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

Phoenix is not sorting by row key when merging results across multiples region servers

New Contributor

I'm running Phoenix in a cluster with 3 region servers and salting the row key specifying the property "SALT_BUCKETS" = 3 when creating the table.

When querying the table I expect the resulting scan to be return ordered by row key but when merging the results across the different RSs but I'm getting a mixed merge rather a sort merge.

I could add an "order by" clause by row key and it solves the issue but it implies to know the row key in advance and adding every time I run a query.

I have also tried setting the property 'phoenix.query.rowKeyOrderSaltedTable' to true in hbase-site.xml as Phoenix documentation suggests but it does not make any difference.

Is there any better way to resolve that rather than appending an "order by" clause to the query??

Using Phoenix 4.4 and HDP 2.4.2

1 ACCEPTED SOLUTION

"phoenix.query.rowKeyOrderSaltedTable" is the client property, can you make sure hbase-site.xml is in the classpath of your application/sqlline.

View solution in original post

4 REPLIES 4

"phoenix.query.rowKeyOrderSaltedTable" is the client property, can you make sure hbase-site.xml is in the classpath of your application/sqlline.

New Contributor

I'm using sqlline.py as phoenix client and it includes "/etc/hbase/conf" in phoenix_class_path, hbase-site.xml file is there with "phoenix.query.rowKeyOrderSaltedTable" to true

would you mind try again by setting this phoenix.query.force.rowkeyorder to true too. as phoenix.query.rowKeyOrderSaltedTable got deprecated with phoenix.query.force.rowkeyorder in some release.

New Contributor

That one did the job! Now I'm getting the results in the right order and I can see the "CLIENT MERGE SORT" in the query plan explanation.

Thanks!

; ;