public static boolean areSameColumns(List<FieldSchema> oldCols, List<FieldSchema> newCols) {
    if (oldCols == newCols) {
      return true;
    }
    if (oldCols == null || newCols == null || oldCols.size() != newCols.size()) {
      return false;
    }
    // We should ignore the case of field names, because some computing engines are case-sensitive, such as Spark.
    List<FieldSchema> transformedOldCols = oldCols.stream()
        .map(col -> new FieldSchema(col.getName().toLowerCase(), col.getType(), col.getComment()))
        .collect(Collectors.toList());
    List<FieldSchema> transformedNewCols = newCols.stream()
        .map(col -> new FieldSchema(col.getName().toLowerCase(), col.getType(), col.getComment()))
        .collect(Collectors.toList());
    return ListUtils.isEqualList(transformedOldCols, transformedNewCols);
  }
Compare the names, types and comments of two lists of {@link FieldSchema}.
<p>
The name of {@link FieldSchema} is compared in the case-insensitive mode
because all names in Hive are case-insensitive.

@param oldCols old columns
@param newCols new columns
@return true if the two columns are the same, false otherwise
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreServerUtils.java