Skip to content

Commit

Permalink
Add ascii -> codepoint translation
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed May 10, 2024
1 parent 91923c1 commit 377f11a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/brad/front_end/front_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,15 @@ async def _run_query_impl(
else:
connection = session.engines.get_reader_connection(engine_to_use)
cursor = connection.cursor_sync()
# HACK: To work around dialect differences between
# Athena/Aurora/Redshift for now. This should be replaced by
# a more robust translation layer.
if engine_to_use == Engine.Athena and "ascii" in query_rep.raw_query:
translated_query = query_rep.raw_query.replace("ascii", "codepoint")
else:
translated_query = query_rep.raw_query
start = universal_now()
await cursor.execute(query_rep.raw_query)
await cursor.execute(translated_query)
end = universal_now()
except (
pyodbc.ProgrammingError,
Expand Down

0 comments on commit 377f11a

Please sign in to comment.