RapidMiner 9.7 is Now Available

Lots of amazing new improvements including true version control! Learn more about what's new here.

CLICK HERE TO DOWNLOAD

Loop through database tables

ammarghammargh Member Posts: 27  Maven
edited November 2018 in Help

RM has a "loop data sets" component.

My data sets are saved in a database. Is there is a way to loop through all database tables?

Answers

  • mschmitzmschmitz Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 2,534  RM Data Scientist

    hi,

     

    not with one operator. You can write a SQL statement generating you table of table names and use a Loop Values on it to get each table name as a macro. You can then use this table in the loop.

     

    ~Martin

    - Head of Data Science Services at RapidMiner -
    Dortmund, Germany
    Thomas_OttSGolbert
  • JEdwardJEdward RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 570   Unicorn

    Yes, you can use the Loop Repository operator and instead of pointing at your local repository point at the //DB/ where your stored connections are. 

    Below is a quick example.

     

    <?xml version="1.0" encoding="UTF-8"?><process version="7.4.000">
    <context>
    <input/>
    <output/>
    <macros/>
    </context>
    <operator activated="true" class="process" compatibility="7.4.000" expanded="true" name="Process">
    <process expanded="true">
    <operator activated="true" class="loop_repository" compatibility="7.4.000" expanded="true" height="82" name="Loop Repository" width="90" x="179" y="136">
    <parameter key="repository_folder" value="//DB/DemoDataStore/Example Sets/"/>
    <parameter key="entry_type" value="IOObject"/>
    <process expanded="true">
    <connect from_port="repository object" to_port="out 1"/>
    <portSpacing port="source_repository object" spacing="0"/>
    <portSpacing port="source_in 1" spacing="0"/>
    <portSpacing port="sink_out 1" spacing="0"/>
    <portSpacing port="sink_out 2" spacing="0"/>
    </process>
    </operator>
    <connect from_op="Loop Repository" from_port="out 1" to_port="result 1"/>
    <portSpacing port="source_input 1" spacing="0"/>
    <portSpacing port="sink_result 1" spacing="0"/>
    <portSpacing port="sink_result 2" spacing="0"/>
    </process>
    </operator>
    </process>
    mschmitzThomas_Ott
Sign In or Register to comment.