fluent / fluent/fluent-plugin-sql

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

オープン
#95 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug needs-investigation
主要言語
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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。