Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: add custom postprocessing function for the ADQL translation #218

Open
kimakan opened this issue Sep 19, 2023 · 0 comments
Open
Labels
app:query concern the query-app feature feature request priority:low

Comments

@kimakan
Copy link
Contributor

kimakan commented Sep 19, 2023

Sometimes it is useful to alter the ADQL translation from the queryparser to make use of the archive specific features, i.e., using pos column for the cone search for a performance boost. For this, one can add a dummy postprocessor function right after the standard translation by the queryparser. This function can be overloaded by the daiquiri app. There is no solution for the implementation yet.

The translation of the ADQL query happens here

def translate_query(query_language, query):
# get the adapter
adapter = DatabaseAdapter()
# translate adql -> mysql string
if query_language == 'adql-2.0':
try:
translator = cache.get_or_set('translator', ADQLQueryTranslator(), 3600)
translator.set_query(query)
if adapter.database_config['ENGINE'] == 'django.db.backends.mysql':
return translator.to_mysql()
elif adapter.database_config['ENGINE'] == 'django.db.backends.postgresql':
return translator.to_postgresql()
else:
raise Exception('Unknown database engine')

@kimakan kimakan added app:query concern the query-app priority:high feature feature request labels Sep 19, 2023
@kimakan kimakan added this to the MiniRelease milestone Sep 19, 2023
@kimakan kimakan removed this from the MiniRelease milestone Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:query concern the query-app feature feature request priority:low
Projects
None yet
Development

No branches or pull requests

1 participant