Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YQL Problem - "The current table has been blocked"

Tags:

yql

I'm new to YQL and am having some problems retrieving data. The query I'm trying to execute is:

select * from yahoo.finance.historicaldata where symbol = "TW.L" and startDate = "01/01/2011" and endDate = "22/01/2011"

I did manage to retrieve some information using a query like this through the YQL Console without a problem. Now whenever I try I get some XML back which includes the message:

The current table 'yahoo.finance.historicaldata' has been blocked. It exceeded the allotted quotas of either time or instructions

I assume this is some sort of rate limit, but I'm pretty sure I'm nowhere near the 1,000 requests per hour quoted as the limit. Also, I am getting an HTTP response 200, not 999 (which is apparently the status you get back when you've been rate limited).

Can anyone tell me why I'm getting this message, what I should do about it, and how I can stop it happening again!?

Thanks, - Chris

like image 976
Chris Roberts Avatar asked Feb 26 '23 07:02

Chris Roberts


2 Answers

I think that this message has nothing to do with a rate limit on your side but rather a global blocking of this table e.g. I get the same error message when I try to access this table. Therefore I rather assume that somebody else has been querying this table too extensively, which in turn resulted in this table being blocked, just like the error message indicates.

The internals of that table show that it is sending two queries to a CSV hosted at http://ichart.finance.yahoo.com/table.csv. You can check the internals yourself here to see what is done in the javascript part of that table: https://github.com/spier/yql-tables/blob/master/yahoo/finance/yahoo.finance.historicaldata.xml

I know that this does not solve your problem with using the YQL table but if you continue having problems with this table then you should probably just query the CSV file directly instead of going through the YQL table.

If you still want to know what the issue with that YQL table is then you could post your question directly in the YQL forum at Yahoo: http://developer.yahoo.net/forum/?showforum=41&cookiecheckonly=1

Please post here as well if you should find out anything else about this. Thx.

like image 73
spier Avatar answered Mar 08 '23 12:03

spier


I think there might be two related problems here: too many instructions, and being run too frequently.

When I run your query in the [YQL console][yql], I see the response in part:

<javascript execution-time="6783" instructions-used="50024350" table-name="yahoo.finance.historicaldata"/>
<javascript name="yahoo.finance.historicaldata" verb="select">
<![CDATA[java.lang.RuntimeException: Too many instructions executed: 50024350]]>
</javascript>

You can see the problem is "too many instructions executed".

Looking at the sample query for that table, it looks like the start & end dates for that table use the yyyy-mm-dd format. Thus, your query could be re-written as:

select * from yahoo.finance.historicaldata where 
  symbol = "TW.L" and 
  startDate = "2011-01-01" and 
  endDate = "2011-01-22"

This updated query worked for me a couple times, but now I'm getting the further error of the table being blocked:

<javascript name="yahoo.finance.historicaldata" verb="select">
<![CDATA[com.yahoo.platforms.pipes.model.ModuleException: Error Codes: 
js.blocked.execute.request Message: "The current table 'yahoo.finance.historicaldata' 
has been blocked. It exceeded the allotted quotas of either time or instructions"]]>
</javascript>

It's possible that one leads to the other; in other words, the malformed request is causing so many instructions to run that it's causing the table to be blocked.

like image 42
BrianC Avatar answered Mar 08 '23 12:03

BrianC