private List<FieldSchema> filterColumns(List<FieldSchema> columns, Matcher matcher) {
    ArrayList<FieldSchema> result = new ArrayList<>();
    for (FieldSchema column : columns) {
      matcher.reset(column.getName());
      if (matcher.matches()) {
        result.add(column);
      }
    }

    if (desc.isSorted()) {
      result.sort(
          new Comparator<FieldSchema>() {
            @Override
            public int compare(FieldSchema f1, FieldSchema f2) {
              return f1.getName().compareTo(f2.getName());
            }
          });
    }
    return result;
  }
Operation process of showing the columns.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/column/show/ShowColumnsOperation.java