Skip to content

Non-provided columns filled with NULL, conflicts with default UUID #95

Description

@theis188

I have a field pkey which defaults to a generated uuid as follows:

pkey UUID NOT NULL DEFAULT uuid_generate_v1(),

I think the plugin is autofilling any missing column with NULL:

2020-08-07 17:14:28 -0400 [error]: #0 Got deterministic error again. Dump a record error_class=ActiveRecord::NotNullViolation error="PG::NotNullViolation: ERROR:  null value in column \"pkey\" violates not-null constraint\nDETAIL:  Failing row contains (null, 2016-06-22 19:10:25, [\"a\", 3], cool_model, 2.0, 0.5).\n: INSERT INTO \"fluentd_test\" (\"pkey\",\"my_datetime\",\"model_data\",\"ml_model_name\",\"model_version\",\"score\") VALUES (NULL,'2016-06-22 19:10:25','[\"a\",3]','cool_model','2.0',0.5)" record=#<Fluent::Plugin::SQLOutput::BaseModel_12752544::FluentdTest pkey: nil, my_datetime: "2016-06-22 19:10:25", model_data: ["a", 3], ml_model_name: "cool_model", model_version: "2.0", score: 0.5>

The INSERT statement could omit the pkey field and the NULL statement and the database would auto-fill with uuid_generate_v1(), so the message would not have to contain uuid.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions