RedShift Bookmarks

Published: 2022-12-23, Updated: 2023-02-08

Gerar UUID Randomico

md5('xpto' || random()::text || sysdate::text )

Formatar hash 36 caracteres para UUID

regexp_replace(lower(replace(t.column_name , 'CUSTOMER:', '')), '([\\w]{8})([\\w]{4})(\\w{4})(\\w{4})(\\w{12})', '$1-$2-$3-$4-$5') 

Create table Padrão

CREATE TABLE public.rleoneti_rumov97
(
	cod_receivable		VARCHAR(36)	ENCODE zstd,
	idt_transaction		BIGINT 		ENCODE az64,
	vlr_settle	DECIMAL(18,2)	ENCODE zstd,
	vlr_settled			DECIMAL(18,2)	ENCODE zstd,
	saldo_c97v		DECIMAL(18,2)	ENCODE zstd,
	saldo_c97v_ate		DECIMAL(18,2)	ENCODE zstd,
	des_receivable_status varchar(30) NULL ENCODE zstd,
	dat_receivable_settled_at TIMESTAMP WITHOUT TIME ZONE   ENCODE zstd,
    PRIMARY KEY (cod_receivable,idt_transaction)
) DISTSTYLE KEY DISTKEY (idt_transaction) SORTKEY (cod_receivable,idt_transaction);

redshift bookmarks, redshift commands


Parcelas Décimo Terceiro Fone Bluetooth com Dual boot (Windows e Linux

Comments