@@ -44,42 +44,42 @@ public final class TempTable {
44
44
45
45
private static final String EXTERNAL_PARAM = "EXTERNAL" ;
46
46
47
- TempTable (org .apache .hadoop .hive .metastore .api .Table t ) {
47
+ public TempTable (org .apache .hadoop .hive .metastore .api .Table t ) {
48
48
assert t != null ;
49
49
this .tTable = t ;
50
50
pTree = t .getPartitionKeysSize () > 0 ? new PartitionTree (tTable ) : null ;
51
51
}
52
52
53
- Partition addPartition (Partition p ) throws AlreadyExistsException , MetaException {
53
+ public Partition addPartition (Partition p ) throws AlreadyExistsException , MetaException {
54
54
String partName = makePartName (tTable .getPartitionKeys (), p .getValues ());
55
55
Partition partition = pTree .addPartition (p , partName , false );
56
56
return partition == null ? pTree .getPartition (partName ) : partition ;
57
57
}
58
58
59
- boolean isExternal () {
59
+ public boolean isExternal () {
60
60
return tTable .getParameters () != null && "true" .equals (tTable .getParameters ().get (EXTERNAL_PARAM ));
61
61
}
62
62
63
- Partition getPartition (String partName ) throws MetaException {
63
+ public Partition getPartition (String partName ) throws MetaException {
64
64
if (partName == null || partName .isEmpty ()) {
65
65
throw new MetaException ("Partition name cannot be null or empty" );
66
66
}
67
67
return pTree .getPartition (partName );
68
68
}
69
69
70
- Partition getPartition (List <String > partVals ) throws MetaException {
70
+ public Partition getPartition (List <String > partVals ) throws MetaException {
71
71
if (partVals == null ) {
72
72
throw new MetaException ("Partition values cannot be null" );
73
73
}
74
74
return pTree .getPartition (partVals );
75
75
}
76
76
77
- List <Partition > addPartitions (List <Partition > partitions , boolean ifNotExists )
77
+ public List <Partition > addPartitions (List <Partition > partitions , boolean ifNotExists )
78
78
throws MetaException , AlreadyExistsException {
79
79
return pTree .addPartitions (partitions , ifNotExists );
80
80
}
81
81
82
- List <Partition > getPartitionsByNames (List <String > partNames ) throws MetaException {
82
+ public List <Partition > getPartitionsByNames (List <String > partNames ) throws MetaException {
83
83
if (partNames == null ) {
84
84
throw new MetaException ("Partition names cannot be null" );
85
85
}
@@ -93,11 +93,11 @@ List<Partition> getPartitionsByNames(List<String> partNames) throws MetaExceptio
93
93
return partitions ;
94
94
}
95
95
96
- List <Partition > getPartitionsByPartitionVals (List <String > partialPartVals ) throws MetaException {
96
+ public List <Partition > getPartitionsByPartitionVals (List <String > partialPartVals ) throws MetaException {
97
97
return pTree .getPartitionsByPartitionVals (partialPartVals );
98
98
}
99
99
100
- Partition getPartitionWithAuthInfo (List <String > partionVals , String userName , List <String > groupNames )
100
+ public Partition getPartitionWithAuthInfo (List <String > partionVals , String userName , List <String > groupNames )
101
101
throws MetaException {
102
102
Partition partition = getPartition (partionVals );
103
103
if (partition == null ) {
@@ -106,11 +106,11 @@ Partition getPartitionWithAuthInfo(List<String> partionVals, String userName, Li
106
106
return checkPrivilegesForPartition (partition , userName , groupNames ) ? partition : null ;
107
107
}
108
108
109
- List <Partition > listPartitions () {
109
+ public List <Partition > listPartitions () {
110
110
return pTree .listPartitions ();
111
111
}
112
112
113
- List <Partition > listPartitionsWithAuthInfo (String userName , List <String > groupNames ) {
113
+ public List <Partition > listPartitionsWithAuthInfo (String userName , List <String > groupNames ) {
114
114
List <Partition > partitions = listPartitions ();
115
115
List <Partition > result = new ArrayList <>();
116
116
partitions .forEach (p -> {
@@ -121,7 +121,7 @@ List<Partition> listPartitionsWithAuthInfo(String userName, List<String> groupNa
121
121
return result ;
122
122
}
123
123
124
- List <Partition > listPartitionsByPartitionValsWithAuthInfo (List <String > partialVals , String userName ,
124
+ public List <Partition > listPartitionsByPartitionValsWithAuthInfo (List <String > partialVals , String userName ,
125
125
List <String > groupNames ) throws MetaException {
126
126
List <Partition > partitions = pTree .getPartitionsByPartitionVals (partialVals );
127
127
List <Partition > result = new ArrayList <>();
@@ -159,11 +159,11 @@ private boolean checkPrivilegesForPartition(Partition partition, String userName
159
159
return true ;
160
160
}
161
161
162
- Partition dropPartition (List <String > partVals ) throws MetaException , NoSuchObjectException {
162
+ public Partition dropPartition (List <String > partVals ) throws MetaException , NoSuchObjectException {
163
163
return pTree .dropPartition (partVals );
164
164
}
165
165
166
- Partition dropPartition (String partitionName ) throws MetaException , NoSuchObjectException {
166
+ public Partition dropPartition (String partitionName ) throws MetaException , NoSuchObjectException {
167
167
Map <String , String > specFromName = makeSpecFromName (partitionName );
168
168
if (specFromName .isEmpty ()) {
169
169
throw new NoSuchObjectException ("Invalid partition name " + partitionName );
@@ -180,29 +180,29 @@ Partition dropPartition(String partitionName) throws MetaException, NoSuchObject
180
180
return pTree .dropPartition (pVals );
181
181
}
182
182
183
- void alterPartition (Partition partition ) throws MetaException , InvalidOperationException , NoSuchObjectException {
183
+ public void alterPartition (Partition partition ) throws MetaException , InvalidOperationException , NoSuchObjectException {
184
184
pTree .alterPartition (partition .getValues (), partition , false );
185
185
}
186
186
187
- void alterPartitions (List <Partition > newParts )
187
+ public void alterPartitions (List <Partition > newParts )
188
188
throws MetaException , InvalidOperationException , NoSuchObjectException {
189
189
pTree .alterPartitions (newParts );
190
190
}
191
191
192
- void renamePartition (List <String > partitionVals , Partition newPart )
192
+ public void renamePartition (List <String > partitionVals , Partition newPart )
193
193
throws MetaException , InvalidOperationException , NoSuchObjectException {
194
194
pTree .renamePartition (partitionVals , newPart );
195
195
}
196
196
197
- int getNumPartitionsByFilter (String filter ) throws MetaException {
197
+ public int getNumPartitionsByFilter (String filter ) throws MetaException {
198
198
return pTree .getPartitionsByFilter (filter ).size ();
199
199
}
200
200
201
- List <Partition > listPartitionsByFilter (String filter ) throws MetaException {
201
+ public List <Partition > listPartitionsByFilter (String filter ) throws MetaException {
202
202
return pTree .getPartitionsByFilter (filter );
203
203
}
204
204
205
- GetPartitionsResponse getPartitionsWithSpecs (GetPartitionsRequest getPartitionsRequest ) throws MetaException {
205
+ public GetPartitionsResponse getPartitionsWithSpecs (GetPartitionsRequest getPartitionsRequest ) throws MetaException {
206
206
return pTree .getPartitionsWithSpecs (getPartitionsRequest );
207
207
}
208
208
0 commit comments