Options

Parametrized Data set read

bondtntbondtnt Member Posts: 7 Contributor II
edited November 2018 in Help
Greetings,

I'm sorry if this question was answered before, I haven't found appropriate thread.
I need to run model on different datasets. All of them are located in DB. I would like to load these data sets inside LoopParameters operator, is it possible to define SQL with included macroses that will be available to LoopParameters operator? In other words is it possible to define macroses and set their values inside LoopParameters operator?

Already thank you for your answers.

Best regards,
Andrey

Answers

  • Options
    bondtntbondtnt Member Posts: 7 Contributor II
    Well, I solved it by extending general Data Loader operator with additional parameters that are placed into SQL query.
  • Options
    IngoRMIngoRM Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
    Hi,

    well, you could have used the operator "Set Macro" inside of the "Loop Parameters" operator and before you use the defined macro then in your SQL query.

    Here is a short example printing three lines to the Log console:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.1.006">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.1.006" expanded="true" name="Process">
        <parameter key="logverbosity" value="notes"/>
        <process expanded="true" height="190" width="413">
          <operator activated="true" class="loop_parameters" compatibility="5.1.006" expanded="true" height="60" name="Loop Parameters" width="90" x="45" y="30">
            <list key="parameters">
              <parameter key="Set Macro.value" value="First,Second,Last One"/>
            </list>
            <process expanded="true" height="741" width="887">
              <operator activated="true" class="set_macro" compatibility="5.1.006" expanded="true" height="60" name="Set Macro" width="90" x="45" y="30">
                <parameter key="macro" value="text"/>
                <parameter key="value" value="Last One"/>
              </operator>
              <operator activated="true" class="print_to_console" compatibility="5.1.006" expanded="true" height="60" name="Print to Console" width="90" x="179" y="30">
                <parameter key="log_value" value="This is line %{a}. The text is '%{text}'."/>
              </operator>
              <portSpacing port="source_input 1" spacing="0"/>
              <portSpacing port="sink_performance" spacing="0"/>
              <portSpacing port="sink_result 1" spacing="0"/>
            </process>
          </operator>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="0"/>
        </process>
      </operator>
    </process>
    Cheers,
    Ingo
Sign In or Register to comment.