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);
  }
@Test
  public void testSameColumns() {
    FieldSchema col1 = new FieldSchema("col1", "string", "col1 comment");
    FieldSchema Col1 = new FieldSchema("Col1", "string", "col1 comment");
    FieldSchema col2 = new FieldSchema("col2", "string", "col2 comment");
    Assert.assertTrue(MetaStoreServerUtils.areSameColumns(null, null));
    Assert.assertFalse(MetaStoreServerUtils.areSameColumns(Arrays.asList(col1), null));
    Assert.assertFalse(MetaStoreServerUtils.areSameColumns(null, Arrays.asList(col1)));
    Assert.assertTrue(MetaStoreServerUtils.areSameColumns(Arrays.asList(col1), Arrays.asList(col1)));
    Assert.assertTrue(MetaStoreServerUtils.areSameColumns(Arrays.asList(col1, col2), Arrays.asList(col1, col2)));
    Assert.assertTrue(MetaStoreServerUtils.areSameColumns(Arrays.asList(Col1, col2), Arrays.asList(col1, col2)));
  }