Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
html:
toc: true
offline: true
export_on_save:
html: true
---
# OrderBy Operator
---
## Operator 설명
- 선택한 column에 대해서 모든 데이터를 오름차순/내림차순으로 정렬한다.
## Operator 파라미터 설명
- selectedColumnId: 정렬을 수행할 column (required)
- method: 정렬 방법(오름차순, 내림차순). Enum(ASC,DESC) (required)
## Operator 모듈 테스트 결과
### 입력 데이터
<table style=text-align="center">
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000100</td><td>1</td><td>29</td>
<tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000200</td><td>2</td><td>36</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000300</td><td>3</td><td>55</td>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000400</td><td>4</td><td>50</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000500</td><td>5</td><td>109</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000600</td><td>6</td><td>73</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000700</td><td>7</td><td>29</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000800</td><td>8</td><td>26</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000900</td><td>9</td><td>17</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000001000</td><td>10</td><td>21</td>
</tr>
</table>
### 결과 데이터
<table style=text-align="center">
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000500</td><td>5</td><td>109</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000600</td><td>6</td><td>73</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000300</td><td>3</td><td>55</td>
<tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000400</td><td>4</td><td>50</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000200</td><td>2</td><td>36</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000100</td><td>1</td><td>29</td>
<tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000800</td><td>8</td><td>26</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000001000</td><td>10</td><td>21</td>
</tr>
<tr>
<td>2015</td><td>9</td><td>1</td><td>0</td><td>0</td><td>1000000900</td><td>9</td><td>17</td>
</tr>
</table>
- parameter를 다음과 같이 설정하였다.
```scala
val orderByColInfo = OrderByColumnInfo.newBuilder()
.setSelectedColumnId(7)
.setMethod(OrderByColumnInfo.Method.DESC)
.build()
```
- 정렬을 할 column을 7번째(마지막) column으로 설정하였다. 결과 DataFrame을 보면 7번째 column에 대해서 내림차순으로 정렬된 것을 확인할 수 있다.