You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Ns G <ns...@gmail.com> on 2016/01/27 13:49:40 UTC

REG: Natural Sort order of columns

Hi There,

Can I get any phoenix column in Natural sort order?

For eg:

If I have column with values as

test11
test500
42
test9
test3
1
51

then the output should be like

1
42
51
test3
test9
test11
test500



any suggestions please?

Thanks,


PS: I have used AlphonumComparator class referred from [
http://www.davekoelle.com/alphanum.html ] which solves the requirementof
sorting a java collection using Collections.sort method.

RE: Natural Sort order of columns

Posted by Michael McAllister <mm...@homeaway.com>.
Use ORDER BY in your select clause:-

https://phoenix.apache.org/language/#select

Michael McAllister
Staff Data Warehouse Engineer | Decision Systems
mmcallister@HomeAway.com<ma...@HomeAway.com> | C: 512.423.7447 | skype: michael.mcallister.ha<ma...@hotmail.com> | webex: https://h.a/mikewebex
[Description: Description: cid:3410354473_30269081]
This electronic communication (including any attachment) is confidential.  If you are not an intended recipient of this communication, please be advised that any disclosure, dissemination, distribution, copying or other use of this communication or any attachment is strictly prohibited.  If you have received this communication in error, please notify the sender immediately by reply e-mail and promptly destroy all electronic and printed copies of this communication and any attachment.

From: Ns G [mailto:nsgnsg84@gmail.com]
Sent: Wednesday, January 27, 2016 6:50 AM
To: user@phoenix.apache.org
Subject: REG: Natural Sort order of columns

Hi There,
Can I get any phoenix column in Natural sort order?
For eg:
If I have column with values as
test11
test500
42
test9
test3
1
51
then the output should be like

1
42
51
test3
test9
test11
test500


any suggestions please?
Thanks,

PS: I have used AlphonumComparator class referred from [ http://www.davekoelle.com/alphanum.html ] which solves the requirementof  sorting a java collection using Collections.sort method.