multi-column primary key
We've begun using this plugin to pull data out of sql tables, but we've run into an issue effectively tailing sql tables where there's not a single primary key, but instead a multi-column primary key. To solve this, we've begun creating views with inefficiently concatenated fields containing the multi-column primary keys, but this is not a particularly strong solution for large tables of data. Is there a recommended strategy for handling this kind of case?
I am having a similar issue as well but with inserting data into a postgres database. It looks like i am passing the data correctly, but I don't know if activerecord-import is removing the id value since it is usually set by activerecord. I am having no problems importing records that do not have a column called 'id'.
Thanks for your help. nd
Postgres Table CREATE TABLE public.diets ( id integer NOT NULL, name character varying(255) COLLATE pg_catalog."default" NOT NULL, description character varying(255) COLLATE pg_catalog."default", kcal_per_g numeric(10,2) NOT NULL, hostname character varying(255) COLLATE pg_catalog."default" NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone, CONSTRAINT diet_id_hostname UNIQUE (hostname, id) )
Fluent-Bit Log: [0] diet.tab: [1523641859.022685000, {"id"=>2, "name"=>"super chow", "description"=>"TEST DIETS 2", "kcal_per_g"=>4.400000, "created_at"=>"2018-04-13T17:50:58.328Z", "updated_at"=>"2018-04-13T17:50:58.328Z", "hostname"=>"test"}]
fluentd.conf
<table diet.tab>
table diets
column_mapping 'id:id,name,description,kcal_per_g,created_at,updated_at,hostname'
</table>
Fluentd Log 2018-04-13 17:52:06 +0000 [error]: #0 Got deterministic error again. Dump a record error="PG::NotNullViolation: ERROR: null value in column "id" violates not-null constraint\nDETAIL: Failing row contains (null, super chow, TEST DIETS 2, 4.40, test, 2018-04-13 17:50:58.328, 2018-04-13 17:52:06.625132).\n: INSERT INTO "diets" ("id","name","description","kcal_per_g","hostname","created_at","updated_at") VALUES (NULL,'super chow','TEST DIETS 2',4.4,'test','2018-04-13 17:50:58.328000','2018-04-13 17:52:06.625132')" error_class=ActiveRecord::StatementInvalid record=#<Fluent::SQLOutput::BaseModel_434829638::Diet id: nil, name: "super chow", description: "TEST DIETS 2", kcal_per_g: #BigDecimal:7fd3de0ef100,'0.44E1',18(27), hostname: "test", created_at: "2018-04-13 17:50:58", updated_at: "2018-04-13 17:50:58">