I'm attempting to ingest data from Hive into GeoMesa Accumulo using a JDBC converter. Here is the configuration I have for the JDBC converter:
geomesa.converters.hive = {
type = "jdbc",
connection = "jdbc:hive2://host:10000/default",
id-field = "$1",
fields = [
{ name = "my_id", type = "string", transform = "$1" },
{ name = "shape", type = "geometry", transform = "geometry($2)" }
]
}
To ingest the data, I use the following command:
echo "SELECT * FROM table" | geomesa-accumulo ingest -u user -p pass -c catalog -s hive.sft -f feature -C hive.conf
Despite having copied the Hive JDBC driver to the GeoMesa library, I encounter the following error when running the above command:
2023-09-13 10:51:59,640 WARN [org.locationtech.geomesa.convert2.package$ErrorHandlingIterator] Failed parsing input:
java.sql.SQLFeatureNotSupportedException: Method not supported
at org.apache.hive.jdbc.HiveConnection.prepareCall(HiveConnection.java:1215)
at org.locationtech.geomesa.convert.jdbc.JdbcConverter$StatementIterator.hasNext(JdbcConverter.scala:86)
at org.locationtech.geomesa.convert2.package$ErrorHandlingIterator.liftedTree1$1(package.scala:84)
at org.locationtech.geomesa.convert2.package$ErrorHandlingIterator.hasNext(package.scala:83)
at org.locationtech.geomesa.convert.jdbc.JdbcConverter$ResultSetIterator.hasNext(JdbcConverter.scala:119)
at org.locationtech.geomesa.utils.collection.CloseableIterator$FlatMapCloseableIterator.hasNext(CloseableIterator.scala:140)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at org.locationtech.geomesa.utils.collection.CloseableIterator$FlatMapCloseableIterator.foreach(CloseableIterator.scala:132)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker.$anonfun$run$7(LocalConverterIngest.scala:179)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker.$anonfun$run$7$adapted(LocalConverterIngest.scala:173)
at org.locationtech.geomesa.utils.io.CloseablePool$CommonsPoolPool.borrow(CloseablePool.scala:68)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker.$anonfun$run$6(LocalConverterIngest.scala:173)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker.$anonfun$run$6$adapted(LocalConverterIngest.scala:172)
at org.locationtech.geomesa.utils.io.package$WithClose$.apply(package.scala:64)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker.$anonfun$run$4(LocalConverterIngest.scala:172)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker.$anonfun$run$4$adapted(LocalConverterIngest.scala:168)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at org.locationtech.geomesa.utils.collection.CloseableIterator$CloseableSingleIterator.foreach(CloseableIterator.scala:85)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker.$anonfun$run$3(LocalConverterIngest.scala:168)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker.$anonfun$run$3$adapted(LocalConverterIngest.scala:167)
at org.locationtech.geomesa.utils.io.package$WithClose$.apply(package.scala:64)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker.$anonfun$run$2(LocalConverterIngest.scala:167)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker.$anonfun$run$2$adapted(LocalConverterIngest.scala:166)
at org.locationtech.geomesa.utils.io.CloseablePool$CommonsPoolPool.borrow(CloseablePool.scala:68)
at org.locationtech.geomesa.tools.ingest.LocalConverterIngest$LocalIngestWorker.run(LocalConverterIngest.scala:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
Does anyone have insights into resolving this issue?
This seems to be a bug in GeoMesa. It should be calling
prepareStatementinstead ofprepareCall, although both seem to work with other databases (e.g. Postgresql). I've opened a ticket to track the issue here.If possible, you could try changing this line to use
prepareStatement, building from source, and then see if that fixes the issue for you.