-
Notifications
You must be signed in to change notification settings - Fork 629
Open
Labels
Description
Observed
- Define a ClickHouse table containing a
Nullable(JSON)column - Insert a
nilstring into this column
Received error is:
code: 117, message: Cannot parse JSON object here:
Expected behaviour
A null value should be inserted into the table
Code example
func TestNullableJSON(t *testing.T) {
ctx := context.Background()
conn, err := clickhouse.Open(&clickhouse.Options{
Addr: []string{"127.0.0.1:9000"},
Auth: clickhouse.Auth{
Database: "default",
Username: "default",
},
})
require.NoError(t, err, "open clickhouse")
_ = conn.Exec(ctx, `DROP TABLE IF EXISTS t`)
err = conn.Exec(ctx, `
CREATE TABLE t
(
data Nullable(JSON)
)
ENGINE = Memory
`)
require.NoError(t, err, "create table")
batch, err := conn.PrepareBatch(ctx, `INSERT INTO t (data) VALUES (?)`)
require.NoError(t, err, "prepare batch")
var s *string
require.NoError(t, batch.Append(s))
require.NoError(t, batch.Send(), "batch send")
}Details
As it appears in similar issue #1638, only Batch behavior is affected.
Environment
-
clickhouse-goversion: v2.40.3 - Interface: ClickHouse API
- Go version: go1.24.10
- Operating system: OSX
- ClickHouse version: 25.8.5.17