Skip to content

Commit 4fc155b

Browse files
committed
Added logging to writeValuePreamble
1 parent 2bb4e81 commit 4fc155b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

flink-connector-clickhouse-base/src/main/java/com/clickhouse/utils/Serialize.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.clickhouse.client.api.data_formats.internal.SerializerUtils;
44
import com.clickhouse.data.ClickHouseDataType;
55
import com.clickhouse.data.format.BinaryStreamUtils;
6+
import org.jline.utils.Log;
67

78
import java.io.IOException;
89
import 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

Comments
 (0)