def _get_abstract_sql(gold_sql, foreign_keys, table_schema,
                      restore_from_clause):
  """Returns string using abstract SQL transformations."""
  print('Processing query:\n%s' % gold_sql)
  sql_spans = abstract_sql.sql_to_sql_spans(gold_sql, table_schema)
  if restore_from_clause:
    sql_spans = abstract_sql.replace_from_clause(sql_spans)
    print('Replaced clause query:\n%s' %
          abstract_sql.sql_spans_to_string(sql_spans))
    sql_spans = abstract_sql.restore_from_clause(sql_spans, foreign_keys)
  return abstract_sql.sql_spans_to_string(sql_spans)
Returns string using abstract SQL transformations.
language/xsp/data_preprocessing/abstract_sql_main.py