Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: split table 2 sets of columns

  1. #1
    Join Date
    Dec 2014
    Posts
    1

    Default split table 2 sets of columns

    I have a postgresql table "A" and would like to separate it into two tables "B" and "C" each taking a different set of columns. from "A". Is it possible to do it using Spoon? What tool should I use?

    Thanks!

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    If tables B and C are in the same database as A, I would use a SQL job entry (INSERT ... SELECT) for this.
    Else I would create a transformation.
    That transformation needs an input step (Table Input) to provide a total (SELECT *) or combined projection (SELECT id, col1, col2) of table A.
    Also we need an output step (Table Output) for each projection (B, C) we want to persist.
    Connect the input step to both output steps selecting "Distribute" for data movement.
    Now configure the output steps.
    Enabling table truncation might be a good idea, too.
    Action "Get Fields" will provide you the list of columns you can use for the projection.
    Good luck.
    So long, and thanks for all the fish.

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.