默认情况下,order by will根据字符串长度以asc形式提供输出。您可以从这个示例中进行检查
input.txt
1 ZZ
2 III
3 II
4 JJJJ
5 Z
6 IIIIII
7 FFF
8 IIII
9 JJ
10 AAA
PigScript:
A = LOAD 'input.txt' using PigStorage(' ') AS (id:int,name:chararray);
B = ORDER A BY name;
DUMP B;
Output:
(10,AAA)
(7,FFF)
(3,II)
(2,III)
(8,IIII)
(6,IIIIII)
(9,JJ)
(4,JJJJ)
(5,Z)
(1,ZZ)
1条答案
按热度按时间mnemlml81#
默认情况下,order by will根据字符串长度以asc形式提供输出。您可以从这个示例中进行检查