For the 1st time i am using MACROS. I want to set the macro dynamically while reading data.
Somnath_Das
New Altair Community Member
<?xml version="1.0" encoding="UTF-8"?><process version="9.9.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="9.4.000" expanded="true" name="Process" origin="GENERATED_TUTORIAL">
<parameter key="logverbosity" value="init"/>
<parameter key="random_seed" value="2001"/>
<parameter key="send_mail" value="never"/>
<parameter key="notification_email" value=""/>
<parameter key="process_duration_for_mail" value="30"/>
<parameter key="encoding" value="SYSTEM"/>
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="9.9.000" expanded="true" height="68" name="Retrieve card_fraud_txns" width="90" x="45" y="34">
<parameter key="repository_entry" value="../data/card/card_fraud_txns"/>
</operator>
<operator activated="true" class="extract_macro" compatibility="9.9.000" expanded="true" height="68" name="Extract Macro" width="90" x="179" y="34">
<parameter key="macro" value="acct"/>
<parameter key="macro_type" value="data_value"/>
<parameter key="statistics" value="average"/>
<parameter key="attribute_name" value="DR_ACCOUNT_ID"/>
<parameter key="example_index" value="1"/>
<list key="additional_macros"/>
</operator>
<operator activated="true" class="jdbc_connectors:read_database" compatibility="9.9.000" expanded="true" height="82" name="Read Database (2)" width="90" x="179" y="136">
<parameter key="define_connection" value="repository"/>
<parameter key="connection_entry" value="/Connections/ML_UAT_DB"/>
<parameter key="database_system" value="MySQL"/>
<parameter key="define_query" value="query"/>
<parameter key="query" value="select * from cust_account where 'hostAcctId' in %{acct}"/>
<parameter key="use_default_schema" value="true"/>
<parameter key="prepare_statement" value="false"/>
<enumeration key="parameters"/>
<parameter key="datamanagement" value="double_array"/>
<parameter key="data_management" value="auto"/>
</operator>
<connect from_op="Retrieve card_fraud_txns" from_port="output" to_op="Extract Macro" to_port="example set"/>
<connect from_op="Read Database (2)" from_port="output" 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"/>
<background height="232" location="//Samples/Tutorials/Basics/01/tutorial1" width="1502" x="26" y="47"/>
</process>
</operator>
</process>
Tagged:
0
Best Answer
-
Hi @Somnath_Das,
You can parameterizing SQL query for loading data dynamically from DB.
https://community.rapidminer.com/discussion/50538/how-to-use-macros
https://community.rapidminer.com/discussion/50302/parameterizing-sql-query/p1
Some other discussions can be found if you do a little bit search
https://community.rapidminer.com/discussion/56583/read-database-query-sql-in
https://community.rapidminer.com/discussion/56671/using-macro-inside-sql-queries
HTH!
Cheers,
-1
Answers
-
Hi @Somnath_Das,
You can parameterizing SQL query for loading data dynamically from DB.
https://community.rapidminer.com/discussion/50538/how-to-use-macros
https://community.rapidminer.com/discussion/50302/parameterizing-sql-query/p1
Some other discussions can be found if you do a little bit search
https://community.rapidminer.com/discussion/56583/read-database-query-sql-in
https://community.rapidminer.com/discussion/56671/using-macro-inside-sql-queries
HTH!
Cheers,
-1