# NullPointerEXception

**URL:** <https://community.dremio.com/t/nullpointerexception/10888>\
**Category:** Uncategorized\
**Created:** [August 11, 2023, 8:11pm UTC](https://community.dremio.com/t/nullpointerexception/10888 "2023-08-11T20:11:40Z")\
**Posts on this page:** 9\
**Page:** 1

<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:** [August 11, 2023, 8:11pm UTC](https://community.dremio.com/t/nullpointerexception/10888/1 "2023-08-11T20:11:40Z")

</div>

Hello we have a NullPointerException when run query that use ARP custom connector.

For futher reference for others, I think this problem is when wrong mappgin precision in ARP yml

com.dremio.common.exceptions.UserException: NullPointerException

```
at com.dremio.common.exceptions.UserException$Builder.build(UserException.java:926)

at com.dremio.exec.planner.sql.SqlExceptionHelper.coerceException(SqlExceptionHelper.java:129)

at com.dremio.exec.planner.sql.handlers.query.DataAdditionCmdHandler.getPlan(DataAdditionCmdHandler.java:232)

at com.dremio.exec.planner.sql.handlers.query.CreateTableHandler.doCtas(CreateTableHandler.java:102)

at com.dremio.exec.planner.sql.handlers.query.CreateTableHandler.getPlan(CreateTableHandler.java:70)

at com.dremio.exec.planner.sql.handlers.commands.HandlerToPreparePlanBase.plan(HandlerToPreparePlanBase.java:91)

at com.dremio.exec.work.foreman.AttemptManager.plan(AttemptManager.java:571)

at com.dremio.exec.work.foreman.AttemptManager.lambda$run$4(AttemptManager.java:462)

at com.dremio.service.commandpool.ReleasableBoundCommandPool.lambda$getWrappedCommand$3(ReleasableBoundCommandPool.java:140)

at com.dremio.service.commandpool.CommandWrapper.run(CommandWrapper.java:70)

at com.dremio.context.RequestContext.run(RequestContext.java:96)

at com.dremio.common.concurrent.ContextMigratingExecutorService.lambda$decorate$4(ContextMigratingExecutorService.java:226)

at com.dremio.common.concurrent.ContextMigratingExecutorService$ComparableRunnable.run(ContextMigratingExecutorService.java:206)

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)

```

Caused by: java.lang.NullPointerException: null

```
at com.dremio.exec.store.jdbc.dialect.arp.ArpYaml.getCastSpec(ArpYaml.java:140)

at com.dremio.exec.store.jdbc.dialect.arp.ArpDialect.getCastSpec(ArpDialect.java:346)

at com.dremio.exec.store.jdbc.dialect.arp.ArpDialect.supportsFunction(ArpDialect.java:355)

at com.dremio.exec.store.jdbc.rules.JdbcJoinRule.canJoinOnCondition(JdbcJoinRule.java:311)

at com.dremio.exec.store.jdbc.rules.JdbcJoinRule.canJoinOnCondition(JdbcJoinRule.java:278)

at com.dremio.exec.store.jdbc.rules.JdbcJoinRule.canJoinOnCondition(JdbcJoinRule.java:249)

```

[a40f5458-7796-41a2-9718-f82ea4ff27c9.zip](https://community.dremio.com/uploads/short-url/l24mgOIwxe1qE6G2okywks0LvOS.zip) (14,0 KB)

---

<div class="post-metadata">

**Author:** ![dch](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/dch/32/4140_2.png) [@dch](https://community.dremio.com/u/dch)\
**Post date:** [August 11, 2023, 8:56pm UTC](https://community.dremio.com/t/nullpointerexception/10888/2 "2023-08-11T20:56:54Z")

</div>

Can we see your yaml file? I suspect your mappings are incomplete too.  
What template are you working off?

---

<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:** [August 11, 2023, 10:15pm UTC](https://community.dremio.com/t/nullpointerexception/10888/3 "2023-08-11T22:15:28Z")

</div>

sure, can you show my post please [IBM db2 arp connector - #2 by Albert\_Vernon](https://community.dremio.com/t/ibm-db2-arp-connector/10859/2)  
and I think is related too to [RuntimeException when planning query](https://community.dremio.com/t/runtimeexception-when-planning-query/10860)

---

<div class="post-metadata">

**Author:** ![dch](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/dch/32/4140_2.png) [@dch](https://community.dremio.com/u/dch)\
**Post date:** [August 11, 2023, 10:33pm UTC](https://community.dremio.com/t/nullpointerexception/10888/4 "2023-08-11T22:33:04Z")

</div>

What are the data types for these:  
S.NUMERO\_TRANSACC  
T2.NUM\_TRANS\_COMISION  
S.CUENTA  
T2.CUENTA  
?

---

<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:** [August 11, 2023, 10:52pm UTC](https://community.dremio.com/t/nullpointerexception/10888/5 "2023-08-11T22:52:33Z")

</div>

| TABLE\_CATALOG | TABLE\_SCHEMA | TABLE\_NAME | COLUMN\_NAME | ORDINAL\_POSITION | COLUMN\_DEFAULT | IS\_NULLABLE | DATA\_TYPE | COLUMN\_SIZE | CHARACTER\_MAXIMUM\_LENGTH | CHARACTER\_OCTET\_LENGTH | NUMERIC\_PRECISION | NUMERIC\_PRECISION\_RADIX | NUMERIC\_SCALE | DATETIME\_PRECISION | INTERVAL\_TYPE | INTERVAL\_PRECISION |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| DREMIO | mupi.MUPI | PS\_TRANSACCION | CUENTA | 9 | | YES | INTEGER | 32 | | | 32 | 2 | 0 | | | |
| DREMIO | mupi.MUPI | PS\_TRANSACCION | NUM\_TRANS\_COMISION | 31 | | YES | DECIMAL | 10 | | | 10 | 10 | 0 | | | |
| DREMIO | mupi.MUPI | AH\_TRANSACCION | CUENTA | 1 | | YES | INTEGER | 32 | | | 32 | 2 | 0 | | | |
| DREMIO | mupi.MUPI | AH\_TRANSACCION | NUMERO\_TRANSACC | 2 | | YES | INTEGER | 32 | | | 32 | 2 | 0 | | | |

---

<div class="post-metadata">

**Author:** ![dch](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/dch/32/4140_2.png) [@dch](https://community.dremio.com/u/dch)\
**Post date:** [August 11, 2023, 11:35pm UTC](https://community.dremio.com/t/nullpointerexception/10888/6 "2023-08-11T23:35:19Z")

</div>

PSA: I know **very little** about APR 🙂 however… can you try adding `required_cast_args` to DECIMAL or add an explicit cast to `S.NUMERO_TRANSACC = T2.NUM_TRANS_COMISION`?

---

<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:** [August 12, 2023, 12:07am UTC](https://community.dremio.com/t/nullpointerexception/10888/7 "2023-08-12T00:07:45Z")

</div>

> [@dch](#):
>
> `required_cast_args`

thank you for your reply.

 ![imagen](https://us1.discourse-cdn.com/flex020/uploads/dremio/original/2X/4/4e550accce0d2d45b16a2666c11e41ec2f0ccc38.png)

I’ve already have this.

with explicit cast works well.

But is strange in some cases, in original source we have for example decimal (16,2) but if use CTAs to iceberg using this query, we have DECIMAL(31,2), let me prepare a complete case to share about this case

---

<div class="post-metadata">

**Author:** ![dch](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/dch/32/4140_2.png) [@dch](https://community.dremio.com/u/dch)\
**Post date:** [August 12, 2023, 12:28am UTC](https://community.dremio.com/t/nullpointerexception/10888/8 "2023-08-12T00:28:26Z")

</div>

Why do you have 2 entries for “decimal”?

---

<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:** [August 12, 2023, 12:31am UTC](https://community.dremio.com/t/nullpointerexception/10888/9 "2023-08-12T00:31:51Z")

</div>

in the last pic attached is only one entry, If I’m not wrong is how arp maps datatype of “source” and which corresponds to “dremio”

for another example

```yaml
    - source:
        name: "NUMERIC"
        max_precision: 31
        max_scale: 30
      required_cast_args: "none"
      dremio:
        name: "decimal"

```
