[druid-user] connecting from presto to druid

Trying to connect from presto to druid…Simple select query fails with
java.lang.NullPointerException: string is null

Query 20210405_073800_00132_ap2pp failed: string is null
java.lang.NullPointerException: string is null
at java.util.Objects.requireNonNull(Objects.java:228)
at io.airlift.slice.Slices.copiedBuffer(Slices.java:291)
at io.airlift.slice.Slices.utf8Slice(Slices.java:299)
at com.facebook.presto.druid.DruidBrokerPageSource.getNextPage(DruidBrokerPageSource.java:158)
at com.facebook.presto.operator.TableScanOperator.getOutput(TableScanOperator.java:251)
at com.facebook.presto.operator.Driver.processInternal(Driver.java:417)
at com.facebook.presto.operator.Driver.lambda$processFor$8(Driver.java:300)
at com.facebook.presto.operator.Driver.tryWithLock(Driver.java:721)
at com.facebook.presto.operator.Driver.processFor(Driver.java:293)
at com.facebook.presto.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:1077)
at com.facebook.presto.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:162)
at com.facebook.presto.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:545)
at com.facebook.presto.$gen.Presto_0_242_bfc43c2____20210401_100816_1.run(Unknown Source)
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:748)

Hi Venugopal Bachu,

Possibility this could be an issue with the presto-druid connector ( maybe, some configuration issue also though I am not sure atm). To confirm that, You can run the same query in Druid > SQL console, if the query works fine from there that means something wrong on the presto side.

Thanks and Regards,
Vaibhav

Check this jira I filed a couple of weeks ago, it might be the reason. Do you set useDefaultValueForNull? If so, and you have a null value, you’ll get that error.
Btw, the trino connector doesn’t have this problem, but you’re probably already using presto. (Also, the trino connector just used jdbc, whereas the presto
connector has more functionality, like being able to write to druid.)