keboola / db-writer-pgsql

Postgre SQL Database Writer
MIT License
0 stars 1 forks source link

Writer accepts column type JSONB but import fails #27

Closed ujovlado closed 6 years ago

ujovlado commented 6 years ago

Ked nastavim jeden zo stlpcov ako JSONB, vytvaraju sa tmp tabulky takto:

CREATE TABLE "customer_events_temp_5ba350ee4d494" (
"id" VARCHAR(255) NOT NULL ,
"customer_entity_id" VARCHAR(255) NULL ,
"source_name" VARCHAR(255) NOT NULL ,
"event_time" TIMESTAMP NOT NULL ,
"type" VARCHAR(255) NOT NULL ,
"version" VARCHAR(255) NOT NULL ,
"payload" JSONB NOT NULL ,
"created" TIMESTAMP NOT NULL , 
PRIMARY KEY ("id") );

a druha:

CREATE TABLE "customer_events_temp_5ba350ee4d494_temp_5ba350f3a047c" (
"id" VARCHAR(255) NULL,
"customer_entity_id" VARCHAR(255) NULL,
"source_name" VARCHAR(255) NULL,
"event_time" VARCHAR(255) NULL,
"type" VARCHAR(255) NULL,
"version" VARCHAR(255) NULL,
"payload" VARCHAR(255) NULL,
"created" VARCHAR(255) NULL)

^ problem nastava, ked mam data dlhsie ako 255 - konkretne v stlpci payload.

Nie som si 100% isty ako by sa to malo chovat spravne, no nemali by byt tie datove typy zachovane? Alebo zvolany taky, ktoru akceptuje viac "textu"?

ErikZigo commented 6 years ago

Do druhe tabulky se importuji data primo z CSV a neda se tam pro nas use case nadefinovat jaky retezec znamena hodnotu NULL.

Proto se to obchazi pres ty textove sloupce. Moje chyba ze jsem nekoukl jake vsechny datove typy umoznujeme nastavovat v UI https://github.com/keboola/kbc-ui/blob/master/src/scripts/modules/wr-db/templates/dataTypes.coffee

tomasfejfar commented 6 years ago

Máme nějaký plán, kdy by to mohlo být fixlé? Máme na zendesku ticket s poslední odpovědí z 22.9., tak jen aby se na to nezapomnělo.

ErikZigo commented 6 years ago

PR hotovy