"[SOLVED] problem merging current Loop Values iteration with rss feed results"

jim21gmsjim21gms MemberPosts:2Contributor I
edited June 2019 inHelp
Hi,
I’m trying to build a very simple process to read an rss url from a database, loop through them and write the result to a table. That part works fine. However in addition to the rss feed results I also need to save the original rss url I used to retrieve the feed along with the Published, Author, Title, Link ect. data from the rss feed. I’ve tried to use the extract macro operator hoping that would give me the value of the current iteration but instead it contains all the rss_url values from the database read and not just the current iteration as I expected. Additionally even if I had the current rss_url iteration how would I merge that and the rss feed results ?

Thanks in advance for you help. Process thus far is below






<宏/ >




<帕拉meter key="connection" value="localDB"/>
<帕拉meter key="query" value="SELECT rss_url FROM `rss_url`"/>



<帕拉meter key="attribute" value="rss_url"/>


<帕拉meter key="url" value="%{loop_value}"/>


<帕拉meter key="connection" value="localDB"/>
<帕拉meter key="table_name" value="rss_output"/>
<帕拉meter key="overwrite_mode" value="overwrite first, append then"/>


<帕拉meter key="macro" value="rss_url"/>
<帕拉meter key="macro_type" value="data_value"/>
<帕拉meter key="attribute_name" value="rss_url"/>
<帕拉meter key="example_index" value="%{a}"/>









< portSpacing端口= " sink_out 4”间隔= " 0 " / >











Answers

  • MariusHelfMariusHelf RapidMiner Certified Expert, MemberPosts:1,869Unicorn
    Hi,

    the extract macro operator sets the value of a macro, but it does not modify the example set. Try sth. like the process below. Maybe it needs some adaption, I didn't test it since I don't have your data. The join operator should join the original table with the rss-contents based on the url of the feed. You have to reenable the Write Database operator and add it at a suitable place in the process.

    All the best,
    Marius





    <宏/ >




    <帕拉meter key="connection" value="localDB"/>
    <帕拉meter key="query" value="SELECT rss_url FROM `rss_url`"/>



    <帕拉meter key="connection" value="localDB"/>
    <帕拉meter key="table_name" value="rss_output"/>
    <帕拉meter key="overwrite_mode" value="overwrite first, append then"/>



    <帕拉meter key="attribute" value="rss_url"/>


    <帕拉meter key="url" value="%{loop_value}"/>









    <帕拉meter key="join_type" value="left"/>
    <帕拉meter key="use_id_attribute_as_key" value="false"/>

    <帕拉meter key="rss_url" value="Link"/>














  • jim21gmsjim21gms MemberPosts:2Contributor I
    Marius,
    works perfect when I join on the ids. Thanks for the quick turnaround and great solution.

    Best regards,
    Jim.

Sign InorRegisterto comment.