Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Multiway merge join

  1. #1
    Join Date
    Feb 2011
    Posts
    240

    Default Multiway merge join

    Hi,

    I've this query:

    SELECT

    CARTELLA.N_CARTELLA as "CARTELLA"
    , COGNOME || NOME as "COGNOME_NOME"
    , CARTELLA.DATA_NASC as "DATA_NASCITA"
    , CARTELLA_ETA.ETA
    , CARTELLA.SESSO
    , CARTELLA.COD_COM_NASC as "COD_COMUNE_NASCITA"
    , COMUNI.DESCRIZIONE as "COMUNE_NASCITA"
    , CARTELLA.CITTADINANZA as "COD_CITTADINANZA"
    , CITTADIN.DES_CITTADIN as "CITTADINANZA"
    , CITTADIN.FLAG_CITTADIN as "UE_EXTRAUE"
    , CARTELLA.COD_REG as "CODICE_SANITARIO"
    , CARTELLA.COD_FISC as "CODICE_FISCALE"
    , CARTELLA.COD_USL as "CODICE_USL"
    , CARTELLA.DATA_APERTURA
    , CARTELLA.DATA_CHIUSURA
    , TAB_VOCI.TAB_DESCRIZIONE as "MOTIVO_CHIUSURA"
    , ANAGRA_C.CITTA as "COD_COMUNE_RES"
    , COMUNI_RES.DESCRIZIONE as "COMUNE_RES"
    , ANAGRA_C.INDIRIZZO as "INDIRIZZO_RES"
    , AREADIS_RES.DESCRIZIONE as "AREADIS_RES"
    , ANAGRA_C.DOM_CITTA as "COD_COMUNE_DOM"
    , COMUNI_DOM.DESCRIZIONE as "COMUNE_DOM"
    , ANAGRA_C.DOM_INDIRIZ as "INDIRIZZO_DOM"
    , AREADIS_DOM.DESCRIZIONE as "AREADIS_DOM"
    , ZONE.DESCRIZIONE_ZONA as "ZONA"
    , DISTRETTI.DES_DISTR as "DISTRETTO"
    , ANAGRA_C.COD_MED as "COD_MMG"
    , MECOGN || MENOME as "MMG"
    , MEDICI.MEFISC as "COD_FISC_MMG"
    , REGION.REGION as "REGIONE"
    , TABUSL.DESUSL as "USL_RESIDENZA"

    FROM SINSNT_TEST.CARTELLA, SINSNT_TEST.CARTELLA_ETA, SINSNT_TEST.COMUNI, SINSNT_TEST.COMUNI_RES, SINSNT_TEST.COMUNI_DOM, SINSNT_TEST.CITTADIN, SINSNT_TEST.TAB_VOCI, SINSNT_TEST.ANAGRA_C, SINSNT_TEST.AREADIS, SINSNT_TEST.AREADIS_DOM, SINSNT_TEST.AREADIS_RES, SINSNT_TEST.MEDICI, SINSNT_TEST.REGION, SINSNT_TEST.ZONE, SINSNT_TEST.DISTRETTI, SINSNT_TEST.TABUSL

    WHERE CARTELLA.N_CARTELLA=CARTELLA_ETA.N_CARTELLA
    and CARTELLA.COD_COM_NASC=COMUNI.CODICE
    and CARTELLA.CITTADINANZA=CITTADIN.CD_CITTADIN
    and TAB_VOCI.TAB_COD='MOTCHI'
    and CARTELLA.MOTIVO_CHIUSURA=TAB_VOCI.TAB_VAL
    and CARTELLA.N_CARTELLA=ANAGRA_C.N_CARTELLA
    and ANAGRA_C.CITTA=COMUNI_RES.CODICE
    and ANAGRA_C.DOM_CITTA=COMUNI_DOM.CODICE
    and ANAGRA_C.AREADIS=AREADIS_RES.CODICE
    and ANAGRA_C.DOM_AREADIS=AREADIS_DOM.CODICE
    and ANAGRA_C.COD_MED=MEDICI.MECODI
    and ANAGRA_C.REGIONE=REGION.CD_REG
    and (ANAGRA_C.REGIONE || ANAGRA_C.USL) = TABUSL.CD_USL
    and AREADIS_DOM.COD_DISTRETTO=DISTRETTI.COD_DISTR
    and DISTRETTI.COD_ZONA=ZONE.CODICE_ZONA

    Can I use the step "multiway merge join"?

  2. #2
    Join Date
    Sep 2011
    Posts
    190

    Default

    Aloha,

    In what way would you like to use this query?

    Would you like to use this query as-is in one input step? If this is a proper query and it runs in your environment, then yes, I see no reason why it shouldn't work.

    If your goal is to rewrite this query as a multiway merge join to do the join in Pentaho insetad of in SQL, then I imagine you can do that too, allthough it's probably tedious.
    Last edited by mbvt; 10-13-2011 at 11:15 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.