fluent / fluent/fluent-plugin-sql
Non-provided columns filled with NULL, conflicts with default UUID
- 主要语言
- Ruby
- 星标
- 112
- 派生
- 58
- PR 合并指标
- 30 天内没有已合并 PR
描述
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=#
```
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.
贡献指南
这个仓库没有索引到贡献指南
调研方向
The issue names no source file or test. Start by tracing the SQL output plugin's ActiveRecord INSERT path and reproducing issue #95 with a PostgreSQL UUID default; done means an omitted pkey allows the database default to populate it, with a regression test covering the behavior.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- postgresql, ruby, sql
- 领域
- databases
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100