def process_columns(columns, tokenizer, table_name, aligned_schema_entities):
  """Processes a column in a table to a TableColumn object."""
  column_obj_list = list()
  for column in columns:
    column_obj = TableColumn()
    column_obj.original_column_name = column['field name']
    column_obj.column_name_wordpieces.extend(
        get_wordpieces(
            column_obj.original_column_name.replace('_', ' '), tokenizer)[0])
    col_type = column['type'].lower()
    if 'int' in col_type or 'float' in col_type or 'double' in col_type or 'decimal' in col_type:
      col_type = 'number'
    if 'varchar' in col_type or 'longtext' in col_type:
      col_type = 'text'
    column_obj.column_type = col_type
    column_obj.table_name = table_name

    column_obj.matches_to_utterance = column_obj.original_column_name.lower(
    ).replace('_', ' ') in aligned_schema_entities

    column_obj.is_foreign_key = column_is_foreign_key(column)
    column_obj_list.append(column_obj)
  return column_obj_list
Processes a column in a table to a TableColumn object.
language/xsp/data_preprocessing/schema_utils.py