@@ -2715,7 +2715,7 @@ private void addPartitionsInternal(String catName, String dbName,
2715
2715
throw new MetaException("Partition does not belong to target table "
2716
2716
+ dbName + "." + tblName + ": " + part);
2717
2717
}
2718
- MPartition mpart = convertToMPart(part, table, true );
2718
+ MPartition mpart = convertToMPart(part, table);
2719
2719
mParts.add(mpart);
2720
2720
int now = (int) (System.currentTimeMillis() / 1000);
2721
2721
List<MPartitionPrivilege> mPartPrivileges = new ArrayList<>();
@@ -2817,7 +2817,7 @@ public boolean addPartitions(String catName, String dbName, String tblName,
2817
2817
Partition part = iterator.next();
2818
2818
2819
2819
if (isValidPartition(part, partitionKeys, ifNotExists)) {
2820
- MPartition mpart = convertToMPart(part, table, true );
2820
+ MPartition mpart = convertToMPart(part, table);
2821
2821
pm.makePersistent(mpart);
2822
2822
if (tabGrants != null) {
2823
2823
for (MTablePrivilege tab : tabGrants) {
@@ -3013,10 +3013,9 @@ private MPartition getMPartition(String catName, String dbName, String tableName
3013
3013
* to the same one as the table's storage descriptor.
3014
3014
* @param part the partition to convert
3015
3015
* @param mt the parent table object
3016
- * @param useTableCD whether to try to use the parent table's column descriptor.
3017
3016
* @return the model partition object, and null if the input partition is null.
3018
3017
*/
3019
- private MPartition convertToMPart(Partition part, MTable mt, boolean useTableCD )
3018
+ private MPartition convertToMPart(Partition part, MTable mt)
3020
3019
throws InvalidObjectException, MetaException {
3021
3020
// NOTE: we don't set writeId in this method. Write ID is only set after validating the
3022
3021
// existing write ID against the caller's valid list.
@@ -3032,8 +3031,7 @@ private MPartition convertToMPart(Partition part, MTable mt, boolean useTableCD)
3032
3031
// use the parent table's, so we do not create a duplicate column descriptor,
3033
3032
// thereby saving space
3034
3033
MStorageDescriptor msd;
3035
- if (useTableCD &&
3036
- mt.getSd() != null && mt.getSd().getCD() != null &&
3034
+ if (mt.getSd() != null && mt.getSd().getCD() != null &&
3037
3035
mt.getSd().getCD().getCols() != null &&
3038
3036
part.getSd() != null &&
3039
3037
convertToFieldSchemas(mt.getSd().getCD().getCols()).
@@ -5188,7 +5186,7 @@ private Partition alterPartitionNoTxn(String catName, String dbname,
5188
5186
catName = normalizeIdentifier(catName);
5189
5187
name = normalizeIdentifier(name);
5190
5188
dbname = normalizeIdentifier(dbname);
5191
- MPartition newp = convertToMPart(newPart, table, false );
5189
+ MPartition newp = convertToMPart(newPart, table);
5192
5190
MColumnDescriptor oldCD = null;
5193
5191
MStorageDescriptor oldSD = oldp.getSd();
5194
5192
if (oldSD != null) {
@@ -5248,9 +5246,6 @@ public Partition alterPartition(String catName, String dbname, String name, List
5248
5246
Partition result = null;
5249
5247
try {
5250
5248
openTransaction();
5251
- if (newPart.isSetWriteId()) {
5252
- LOG.warn("Alter partitions with write ID called without transaction information");
5253
- }
5254
5249
Ref<MColumnDescriptor> oldCd = new Ref<>();
5255
5250
result = alterPartitionNoTxn(catName, dbname, name, part_vals, newPart, validWriteIds, oldCd);
5256
5251
removeUnusedColumnDescriptor(oldCd.t);
0 commit comments