def _get_schema_string(table_json):
  """Returns the schema serialized as a string."""
  table_id_to_column_names = collections.defaultdict(list)
  for table_id, name in table_json["column_names_original"]:
    table_id_to_column_names[table_id].append(name.lower())
  tables = table_json["table_names_original"]

  table_strings = []
  for table_id, table_name in enumerate(tables):
    column_names = table_id_to_column_names[table_id]
    table_string = " | %s : %s" % (table_name.lower(), " , ".join(column_names))
    table_strings.append(table_string)

  return "".join(table_strings)
Returns the schema serialized as a string.
language/compgen/nqg/tasks/spider/append_schema.py