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

Use converted mysql converted query into local DB #18

Open
burnout87 opened this issue Aug 12, 2024 · 5 comments
Open

Use converted mysql converted query into local DB #18

burnout87 opened this issue Aug 12, 2024 · 5 comments

Comments

@burnout87
Copy link

I am using this library to convert native ADQL queries to mysql in order to use those on our DB.
But I am encountering some issue when trying to run the converted query.

Example:

If I want to convert and run the following ADQL query:

"SELECT *
FROM local_schema.local_table
WHERE 1 = CONTAINS(POINT('ICRS', ra, dec),
                   CIRCLE('ICRS',4.2917,-0.4629, 0.008));"

I get the following mysql query:

'SELECT * 
FROM `local_schema`.`local_table` 
WHERE 1 = srcontainsl(spoint(RADIANS(`ra`), RADIANS(`dec`)), 
                    scircle(spoint(RADIANS(4.2917), RADIANS(-0.4629)), 
                    RADIANS(0.008)));'

But when I try to run this mysql query I get the error that the function srcontainsl is not defined, which is quite self-explanatory.

Now, I would like to understand what is the process of defining this (and all the others) function on my local DB?

I also looked into the documentation of diango-daiquiri , but could not find much.

Can you help?

thanks a lot

@kimakan
Copy link
Contributor

kimakan commented Aug 13, 2024

The translated ADQL query requires mysql_sphere (or pg_sphere for PostgreSQL) installed on the DB.

Keep in mind that we don't actively develop the MySQL related modules of the queryparser anymore bringing more focus on PostgreSQL. However, all available functionality for MySQL developed until now remains in the code, also in the upcoming versions.

@burnout87
Copy link
Author

Hi @kimakan ,

thanks for your reply, I will try and let you know.

And yes, I read about the ending of the support for MySQL, but, at the moment, our data are on a MySQL database, so this is the way to follow for us, but we will keep this in mind for future development.

Thanks

@burnout87
Copy link
Author

Hi again,

As already described ? I am (trying to) install mysql_sphere locally on my system, but I am encountering the same (old) errors described here aipescience/mysql_sphere#7

Perhaps you habe an idea on what is going on...

PS I am using mariaDB version:

mariadb Ver 15.1 Distrib 10.4.34-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Thanks for your help

@kimakan
Copy link
Contributor

kimakan commented Aug 16, 2024

Unfortunately, we dropped the development of the mysql_sphere a long time ago. Personally, I couldn't be of any help here since I wasn't even involved back then.

@burnout87
Copy link
Author

Ok, thanks a lot for your help anyway.

I will see what I can do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants