33import com .clickhouse .client .api .data_formats .internal .SerializerUtils ;
44import com .clickhouse .data .ClickHouseDataType ;
55import com .clickhouse .data .format .BinaryStreamUtils ;
6+ import org .jline .utils .Log ;
67
78import java .io .IOException ;
89import java .io .OutputStream ;
@@ -28,6 +29,7 @@ public static boolean writePrimitiveValuePreamble(OutputStream out, boolean defa
2829 return true ;
2930 }
3031 public static boolean writeValuePreamble (OutputStream out , boolean defaultsSupport , boolean isNullable , ClickHouseDataType dataType , boolean hasDefault , String column , Object value ) throws IOException {
32+ Log .debug ("writeValuePreamble[defaultsSupport='%s', isNullable='%s', dataType='%s', column='%s', value='%s']" );
3133 if (defaultsSupport ) {
3234 if (value != null ) {
3335 SerializerUtils .writeNonNull (out );
@@ -49,7 +51,7 @@ public static boolean writeValuePreamble(OutputStream out, boolean defaultsSuppo
4951 if (dataType == ClickHouseDataType .Array ) {
5052 SerializerUtils .writeNonNull (out );
5153 } else if (dataType != ClickHouseDataType .Dynamic ) {
52- throw new IllegalArgumentException (String .format ("An attempt to write null into not nullable column '%s'" , column ));
54+ throw new IllegalArgumentException (String .format ("An attempt to write null into not nullable column '%s' of type '%s' " , column , dataType ));
5355 }
5456 }
5557 } else if (isNullable ) {
@@ -63,7 +65,7 @@ public static boolean writeValuePreamble(OutputStream out, boolean defaultsSuppo
6365 if (dataType == ClickHouseDataType .Array ) {
6466 SerializerUtils .writeNonNull (out );
6567 } else if (dataType != ClickHouseDataType .Dynamic ) {
66- throw new IllegalArgumentException (String .format ("An attempt to write null into not nullable column '%s'" , column ));
68+ throw new IllegalArgumentException (String .format ("An attempt to write null into not nullable column '%s' of type '%s' " , column , dataType ));
6769 }
6870 }
6971 return true ;
0 commit comments