0

Recursive YQL table

Hi,

in my table's <execute>, I'd like to make a y.query call to the same table (with different parameters, obviously). Recursion, that is. YQL is giving an error about making a circular call to the table...

CODE
Exception: Circular table reference detected while using 'deepdapper'. This table was already used in the call stack deepdapper


I find no clear statement whether or not recursion is supported, so could someone just make a confirmation on this?

And if I would cloak the call as a rest call? Would that be a problem?

Groeten,
Vic

by
4 Replies
  • Hi Vic,

    Recursive calls to the same table in the call chain are not supported. If it is cloaked as a rest call, the yql depth originating from the current table would indicate this and prevent this rest call.
    This is done to prevent any harm to the YQL servers actually. Can you describe your use case a bit more? Maybe there's another solution to the issue?

    -- Nagesh
    QUOTE (vic m @ May 31 2010, 12:02 PM) <{POST_SNAPBACK}>
    Hi,

    in my table's <execute>, I'd like to make a y.query call to the same table (with different parameters, obviously). Recursion, that is. YQL is giving an error about making a circular call to the table...

    CODE
    Exception: Circular table reference detected while using 'deepdapper'. This table was already used in the call stack deepdapper


    I find no clear statement whether or not recursion is supported, so could someone just make a confirmation on this?

    And if I would cloak the call as a rest call? Would that be a problem?

    Groeten,
    Vic
    0
  • QUOTE (Nagesh Susarla @ May 31 2010, 09:00 PM) <{POST_SNAPBACK}>
    Hi Vic,

    Recursive calls to the same table in the call chain are not supported. If it is cloaked as a rest call, the yql depth originating from the current table would indicate this and prevent this rest call.
    This is done to prevent any harm to the YQL servers actually. Can you describe your use case a bit more? Maybe there's another solution to the issue?

    -- Nagesh


    Hi,

    thank you very much for that information!

    My attempt was to scrape data from paged html content. The table would scrape the content from the first page (the one provided in the where clause), then go looking for a 'next page' hyperlink and call itself again providing the next page url in the where clause, and return the collected data from the first page bundled with the data collected by the recursive call.

    I guess I may have to look into the Open Tables paging functionality, or rewrite the algorithm as a loop.

    Groeten,
    Vic
    0
  • Hi,

    the loop design was even simpler.

    This is what I've been making:

    http://docs.google.com/View?id=ddq89pzk_199f54jdwcb

    Groeten,
    Vic

    QUOTE (vic m @ May 31 2010, 10:48 PM) <{POST_SNAPBACK}>
    Hi,

    thank you very much for that information!

    My attempt was to scrape data from paged html content. The table would scrape the content from the first page (the one provided in the where clause), then go looking for a 'next page' hyperlink and call itself again providing the next page url in the where clause, and return the collected data from the first page bundled with the data collected by the recursive call.

    I guess I may have to look into the Open Tables paging functionality, or rewrite the algorithm as a loop.

    Groeten,
    Vic
    0
  • QUOTE (vic m @ Jun 2 2010, 11:45 AM) <{POST_SNAPBACK}>
    Hi,

    the loop design was even simpler.

    This is what I've been making:

    http://docs.google.com/View?id=ddq89pzk_199f54jdwcb

    Groeten,
    Vic


    Cool! Looks great. You may want to limit nextcount to say 10 by default to ensure that the table doesnt run over the 30 secs time limit.

    -- Nagesh
    0

Recent Posts

in YQL