apache/incubator-baremaps

SQL Join Erreur

julsbreakdown opened this issue · 5 comments

I cant seem to get a JOIN with an sql statement.
SELECT uuid_hash(ega.id)::integer, jsonb_build_object('nom', ega.nom[1]::text, 'couleur', ta.couleur ) as tags, geom FROM nexsis.ega JOIN typologie.typologie_activite ta ON (ega.id_typologie= ta.id)
Will give me a syntax error
with the sql statement
h4b7f106c as (select * from nexsis.egaLEFT JOIN typologie.typologie_activite ta ON
The space seems to be removed before a JOIN.
i"ve tried using alias, doing a simple JOiN ect ... but the same error. Seems only to be with JOIN because adding WHERE after does work

Is there a limitation to the sql (no joins allowed?)

Hello @julsbreakdown, it looks like you are not using the latest version of baremaps. In the latest version, the sql generated by baremaps got simpler. Could you give it a try? I already spotted minor issues in the latest release, they have been fixed in main and will be released soon.

This is with the v0.7.2
version =(

You are right, sorry, I believed the latest changes had been released. Regarding the query, it would be nice to add a few test cases that ensure this kind of JOIN queries pass. Is this something you could contribute?

If you point me out to where why not.
However i'm not a Java expert !

I guess the easiest would be to add a failing example in the example directory. Having a simple sql script to initialize a database and a tileset with the problematic query would greatly help at reproducing the problem.