# I'm writing an ARP plugin but now I'm stuck

**URL:** <https://community.dremio.com/t/im-writing-an-arp-plugin-but-now-im-stuck/5063>\
**Category:** Uncategorized\
**Created:** [February 14, 2020, 9:56pm UTC](https://community.dremio.com/t/im-writing-an-arp-plugin-but-now-im-stuck/5063 "2020-02-14T21:56:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreat](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/andreat/32/2311_2.png) [@andreat](https://community.dremio.com/u/andreat)\
**Post date:** [February 14, 2020, 9:56pm UTC](https://community.dremio.com/t/im-writing-an-arp-plugin-but-now-im-stuck/5063/1 "2020-02-14T21:56:33Z")

</div>

Hi everyone, I’m trying to write a plugin using a jdbc driver and the arp framework. The fetch of the schema occurs and I can see the list of tables, but when I decide to display any of them, I get a stacktrace that does not help me in debugging at all. I’m trying to understand the workflow, consider that I have to force both the usePrepareForColumnMetadata and usePrepareForGetTables (of the JdbcSchemaFetcher class) methods that return false. In what methods is the fetching of the single rows performed? This is what I always get in the logs:

> 2020-02-14 21:41:59,744 [21b8ebdc-517d-7ddc-a455-ce1128ceac00/0:foreman-planning] ERROR c.d.s.commandpool.CommandWrapper - command 21b8ebdc-517d-7ddc-a455-ce1128ceac00/0:foreman-planning failed  
> com.dremio.common.exceptions.UserException: **Selected table has no columns.**  
> at com.dremio.common.exceptions.UserException$Builder.build(UserException.java:776) ~[dremio-common-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.record.BatchSchema.toCalciteRecordType(BatchSchema.java:233) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.store.NamespaceTable.getRowType(NamespaceTable.java:66) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.catalog.DremioPrepareTable$1.get(DremioPrepareTable.java:63) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.catalog.DremioPrepareTable$1.get(DremioPrepareTable.java:60) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.catalog.DremioPrepareTable.getRowType(DremioPrepareTable.java:80) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at org.apache.calcite.sql.validate.TableNamespace.validateImpl(TableNamespace.java:61) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:943) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.AbstractNamespace.getRowType(AbstractNamespace.java:115) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.IdentifierNamespace.validateImpl(IdentifierNamespace.java:148) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:943) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:924) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2971) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateFrom(SqlValidatorImpl.java:2956) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateSelect(SqlValidatorImpl.java:3197) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.SelectNamespace.validateImpl(SelectNamespace.java:60) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.AbstractNamespace.validate(AbstractNamespace.java:84) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateNamespace(SqlValidatorImpl.java:943) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateQuery(SqlValidatorImpl.java:924) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.SqlSelect.validate(SqlSelect.java:226) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:899) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:609) ~[calcite-core-1.16.0-201909031936280585-3f76472.jar:1.16.0-201909031936280585-3f76472]  
> at com.dremio.exec.planner.sql.SqlConverter.validate(SqlConverter.java:229) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.planner.sql.handlers.PrelTransformer.validateNode(PrelTransformer.java:184) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.planner.sql.handlers.PrelTransformer.validateAndConvert(PrelTransformer.java:173) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.planner.sql.handlers.PrelTransformer.validateAndConvert(PrelTransformer.java:169) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.planner.sql.handlers.query.NormalHandler.getPlan(NormalHandler.java:43) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.planner.sql.handlers.commands.HandlerToExec.plan(HandlerToExec.java:70) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.work.foreman.AttemptManager.plan(AttemptManager.java:415) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.exec.work.foreman.AttemptManager.lambda$run$0(AttemptManager.java:324) ~[dremio-sabot-kernel-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at com.dremio.service.commandpool.CommandWrapper.run(CommandWrapper.java:62) ~[dremio-services-commandpool-4.1.4-202001240912140359-a90eb503.jar:4.1.4-202001240912140359-a90eb503]  
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0\_231]  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0\_231]  
> at java.lang.Thread.run(Thread.java:748) [na:1.8.0\_231]

---

<div class="post-metadata">

**Author:** ![dacopan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/dacopan/32/4289_2.png) [@dacopan](https://community.dremio.com/u/dacopan)\
**Post date:** [February 15, 2020, 1:27am UTC](https://community.dremio.com/t/im-writing-an-arp-plugin-but-now-im-stuck/5063/2 "2020-02-15T01:27:03Z")

</div>

Which database are use you?  
What driver? Name? Versión?  
Upload your arp code  
And provide logs in debug, see oficial documentation for enable debug for arp

---

<div class="post-metadata">

**Author:** ![andreat](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/andreat/32/2311_2.png) [@andreat](https://community.dremio.com/u/andreat)\
**Post date:** [February 16, 2020, 9:34am UTC](https://community.dremio.com/t/im-writing-an-arp-plugin-but-now-im-stuck/5063/3 "2020-02-16T09:34:24Z")

</div>

Thank you for the answer.  
I managed to change things, I realized that I have two versions of antlr4-runtime in the jars directory, so I removed one and now I get a different error, which is better anyway. if I need further help, I will not hesitate to write more details.  
EDIT: i have the same problem, but i’m considering resolving jar conflicts  
EDIT2: i managed to get a more explanatory stacktrace, as soon as I can I will update here on the thread.

---

<div class="post-metadata">

**Author:** ![andreat](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/andreat/32/2311_2.png) [@andreat](https://community.dremio.com/u/andreat)\
**Post date:** [February 19, 2020, 3:15pm UTC](https://community.dremio.com/t/im-writing-an-arp-plugin-but-now-im-stuck/5063/4 "2020-02-19T15:15:33Z")

</div>

In the end I managed to solve, the problem was the jdbc driver, which actually returned 0 columns.
