def sql_spans_to_string(sql_spans, sep=' '):
  """Converts list of SqlSpan tuples to string."""
  strings = []
  for span in sql_spans:
    if span.sql_token:
      strings.append(span.sql_token)
    elif span.column:
      strings.append('%s.%s' %
                     (span.column.table_name, span.column.column_name))
    elif span.table_name:
      strings.append(span.table_name)
    elif span.value_literal:
      strings.append(span.value_literal)
    elif span.nested_statement:
      strings.append(sql_spans_to_string(span.nested_statement))
  return sep.join(strings)
Converts list of SqlSpan tuples to string.
language/xsp/data_preprocessing/abstract_sql.py