def _populate_spans_for_statement(grouped_tokens, sql_spans, table_schemas):
  """Populates sql_spans for list of tokens representing a SQL statement."""
  # List of SqlTable tuples.
  tables = _get_tables(grouped_tokens)
  # TODO(petershaw): Consider unaliased tables for handling ambiguous `*` case.
  aliases_to_table_names = {table.alias: table.table_name for table in tables}
  _populate_spans_for_token(grouped_tokens, tables, aliases_to_table_names,
                            table_schemas, sql_spans)
Populates sql_spans for list of tokens representing a SQL statement.
language/xsp/data_preprocessing/abstract_sql.py