clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

The field type is DateTime,the default value is null

Open wdream opened this issue 3 years ago • 4 comments

The field type is DateTime, the default value is null, and NullPointException when a query is mapped to a Java. image

wdream avatar Jul 27 '22 09:07 wdream

Hi @wdream, so the column is defined as ts DateTime DEFAULT NULL? Could you share more information to help me reproduce the issue?

zhicwu avatar Jul 27 '22 22:07 zhicwu

gmt_register Nullable(DateTime) default NULL When you set it up like this, you get a problem

wdream avatar Jul 28 '22 07:07 wdream

gmt_register Nullable(DateTime) default NULL When you set it up like this, you get a problem

I assume you're using latest driver but I was not able to reproduce the issue. Could you provide more details and maybe minimum code for reproducing?

zhicwu avatar Aug 02 '22 00:08 zhicwu

I use Java programming and set the field type as Date. When the type in DB is Nullable(DateTime) default NULL and the value is NULL, an error will be reported when the query comes out

wdream avatar Aug 08 '22 03:08 wdream