Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] web/email now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as Plain Text by registered user vvillacorta ( 3 years ago )
DROP TABLE IF EXISTS ................................T_MERCADO_BPE_ADQ_SF_P04


CREATE TABLE ....................................T_MERCADO_BPE_ADQ_SF_P04
WITH ( format = 'Parquet', 
       parquet_compression = 'SNAPPY', 
       partitioned_by = ARRAY['PERIODO'], 
       external_location= 's3://.........................................................................../T_MERCADO_BPE_ADQ_SF_P04/'
)
AS (
  
  SELECT AA.CODSBS, AA.COD_EMPRESA, coalesce(BB.SALDO_AJUSTADO, 0) SALDO_AJUSTADO, AA.PERIODO 
  FROM ..................................T_MERCADO_BPE_ADQ_SF_P03_AUTOCOMPLETADO_U9M AA
  LEFT JOIN .................................T_MERCADO_BPE_ADQ_SF_P03 BB
  ON AA.CODSBS = BB.CODSBS
     AND AA.COD_EMPRESA = BB.COD_EMPRESA
     AND AA.PERIODO = CAST(BB.PERIODO as varchar)
  
)

 

Revise this Paste

Your Name: Code Language: