Hi Elpida,

This is because you are using the shaded jar of Sedona and it shaded
jts-core which leads to this conflict if other package also uses
jts-core.


Quick fix (might still fail): use jts-core 1.19.0. Because we
committed a PR to JTS 1.19 that introduces key changes needed by
Sedona: https://github.com/locationtech/jts/pull/634

Ultimate solution: use the unshaded Sedona jar:
https://sedona.apache.org/1.5.0/setup/maven-coordinates/#use-sedona-unshaded-jars

If you already use a Maven dependency resolver, using this jar should
directly fix your problem. If, in the past, you manually download
Sedona jars and put it SPARK_HOME/jars, you will need to make sure the
followings jars are put there as well:

https://github.com/apache/sedona/blob/master/pom.xml#L144-L164
https://github.com/apache/sedona/blob/master/pom.xml#L338-L357

But among those jars, only jts-core is really necessary. Other jars
can be put in place on a need-to-have basis. Remember: jts-core 1.19
is needed.

Thanks,
Jia

On Tue, Dec 12, 2023 at 12:39 AM Kartsakli, Elpida
<elpida.kartsa...@circana.com.invalid> wrote:
>
> Hello,
>
> I am using Sedona 1.4.1 with pyspark (spark 3.0 and scala 2.13). When doing 
> an ST_Intersects query which is giving the following error:
> java.lang.IllegalAccessError: class 
> org.locationtech.jts.index.quadtree.IndexSerde tried to access method 
> 'org.locationtech.jts.index.quadtree.Root 
> org.locationtech.jts.index.quadtree.Quadtree.getRoot()' 
> (org.locationtech.jts.index.quadtree.IndexSerde is in unnamed module of 
> loader org.apache.spark.util.MutableURLClassLoader @6c1832aa; 
> org.locationtech.jts.index.quadtree.Quadtree is in unnamed module of loader 
> 'app')
>
> I've noticed that removing jts-core package solves this, however, due to 
> other dependencies I cannot remove it permanently. I've also tried working 
> with versions 1.18.0, 1.18.2 and 1.19.0 of jts-core.
>
> Regards,
> Elpida

Reply via email to