adesh-rao commented on a change in pull request #1215:
URL: https://github.com/apache/hive/pull/1215#discussion_r452724372



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreServerUtils.java
##########
@@ -501,6 +502,28 @@ public static boolean areSameColumns(List<FieldSchema> 
oldCols, List<FieldSchema
     return ListUtils.isEqualList(oldCols, newCols);
   }
 
+  /**
+   * Returns true if p is a prefix of s.
+   */
+  public static boolean arePrefixColumns(List<FieldSchema> p, 
List<FieldSchema> s) {
+    if (p == s) {
+      return true;
+    }
+    if (p.size() > s.size()) {
+      return false;
+    }
+    Iterator itP = p.iterator();

Review comment:
       @kgyrtkirk Maybe we can use `ListUtils.isEqualList(p, s.subList(0, 
p.size()))`? that way we can avoid most of the code here?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to