# Dremio DateTime to Timestamp to VARCHAR implicit conversion

**URL:** <https://community.dremio.com/t/dremio-datetime-to-timestamp-to-varchar-implicit-conversion/7337>\
**Category:** Uncategorized\
**Created:** [April 26, 2021, 6:52am UTC](https://community.dremio.com/t/dremio-datetime-to-timestamp-to-varchar-implicit-conversion/7337 "2021-04-26T06:52:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gururajnayak](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/gururajnayak/32/3316_2.png) [@gururajnayak](https://community.dremio.com/u/gururajnayak)\
**Post date:** [April 26, 2021, 6:52am UTC](https://community.dremio.com/t/dremio-datetime-to-timestamp-to-varchar-implicit-conversion/7337/1 "2021-04-26T06:52:17Z")

</div>

Iam using Dremio to query multiple data sources. I have a Source DB as SAPIQ with a ‘DateTime’ column as the datatype with value such as “2002-11-11 10:04:20” (FORMAT : YYYY-MM-DD hh:mm:ss).  
The issue is when I query the tables “Select \* from TableABC” then I get a nullpointer exception with Datetime not being able to convert to timestamp.  
However the below query works when I specify the columns with cast function.

{  
SELECT ColumnA, ColumnB, CAST(ColumnTS as VARCHAR), ColumnD FROM TableABC;  
}

Please note source DataType is DATETIME in SAPIQ.  
Dremio converts it to Timestamp but throws nullpointer and the query works only if i convert Timestamp to VARCHAR as shown above.  
This above query works as I am having an explicit conversion. But my issue is i want the conversion to be implicit such that `Select * from TableABC` is able to fetch me the results without any NullPointerException.

I have already tried the below in “src/main/resources/arp/implementation/sybase-arp.yaml” with no success. The below config throws me NullPointerException.  
Source code at [GitHub - dremioJonny/dremio-sybase-connector](https://github.com/dremioJonny/dremio-sybase-connector)  
{  
…  
…  
- source:  
name: “DATETIME”  
max\_scale: 8  
dremio:  
name: “varchar” (is “timestamp” by default)  
default\_cast\_spec: true  
…  
…  
}

Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![gururajnayak](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/gururajnayak/32/3316_2.png) [@gururajnayak](https://community.dremio.com/u/gururajnayak)\
**Post date:** [April 28, 2021, 9:50am UTC](https://community.dremio.com/t/dremio-datetime-to-timestamp-to-varchar-implicit-conversion/7337/2 "2021-04-28T09:50:24Z")

</div>

Hi Dremio support Team,

is there anything in the ARP framework to help me here any function that i could write. Please help me with this issue.
