NPE on INSERT into column in altered table
See original GitHub issueCrateDB version
4.5.1
CrateDB setup information
Number of nodes: 3 12 GB heap
Steps to Reproduce
CREATE TABLE IF NOT EXISTS "doc"."0x001" (
"ts" TIMESTAMP WITHOUT TIME ZONE,
"stream_id" TEXT,
"01_01" OBJECT,
"01_02" OBJECT,
"01_03" OBJECT,
....
"ts_partition" TIMESTAMP WITHOUT TIME ZONE GENERATED ALWAYS AS _cast(date_trunc('quarter', 'UTC', "ts"), 'timestamp without time zone')
)
CLUSTERED BY ("stream_id") INTO 6 SHARDS
PARTITIONED BY ("ts_partition")
WITH (
"allocation.max_retries" = 5,
"blocks.metadata" = false,
"blocks.read" = false,
"blocks.read_only" = false,
"blocks.read_only_allow_delete" = false,
"blocks.write" = false,
codec = 'default',
column_policy = 'strict',
"mapping.total_fields.limit" = 1000,
max_ngram_diff = 1,
max_shingle_diff = 3,
number_of_replicas = '0-1',
"routing.allocation.enable" = 'all',
"routing.allocation.total_shards_per_node" = -1,
"store.type" = 'fs',
"translog.durability" = 'REQUEST',
"translog.flush_threshold_size" = 536870912,
"translog.sync_interval" = 5000,
"unassigned.node_left.delayed_timeout" = 60000,
"write.wait_for_active_shards" = '1'
)
Inserting works ok so far, then altered table:
alter table "doc"."0x001" add column "02_0815" OBJECT;
everything still works ok, but after a view days, we cannot insert into the new column 02_0815 anymore: error: NullpointerException[null], code: 5000, trace: Java.Lang.NullpointerException We insert via http and do not always get this error, but most of the time Status 200, and rowcount(s) : -2 Also tried inserting via the AdminUI, same result, NullpointerException[null] ! But: inserting into all the other columns still works !
Tried to create another OBJECT column in this table, same result. At this point the table has:
- 707 columns
- 132 MIO records
- Size 19.1 GB
- Shards 48
The sys.jobs_log table shows the insert statements, but error column is always null.
We then created another table with just 1 OBJECT column (and the other columns from the first table): inserting works as expected.
Expected Result
INSERTING works or get a decent error message.
Actual Result
error: NullpointerException[null], code: 5000, trace: Java.Lang.NullpointerException
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
For clarification: the number of columns I posted above is the result of
707
We do NOT have more than 700 OBJECT(DYNAMIC) columns in the table
Tried to replicate this with a restore of the affected table with
when trying to insert
edit: Seems like something is breaking the table (schema / metadata). Even after deleting all partition the
INSERT
fails. While on a freshly created it succeedsedit2: @seut stacktrace: