fhunleth

fhunleth

Co-author of Nerves

Output data no longer available message with req_athena

I’m trying to track down a weird behavior from req_athena when running queries that take longer than 10 seconds. This is all running in Livebook.

What happens is the req_athena query/2 call runs for 10 seconds, then the DataFrame that’s returned gets rendered by kino_explorer as “Output data no longer available, please reevaluate this cell”. If you wait a few more seconds (depending on the query), the data appears and everything is fine. Everyone’s first reaction is to reevaluate the cell as directed. That obviously doesn’t help, so I’m trying to figure out if I can either make the query call wait long enough to avoid the message or change the message.

I tried calling Explorer.DataFrame.collect/1 on the results. This helps, but I think it helps mostly by delaying a little longer. The “Output data no longer available” error still shows momentarily.

Just in case we’re doing it wrong, here’s how we’re calling req_athena in the cell:

query = "<long SQL query>"
query_hash = q |> :erlang.md5() |> Base.encode16()

opts = [format: :explorer, output_location: "#{bucket}/livebook-#{query_hash}", ...]
response = ReqAthena.new(opts) |> ReqAthena.query!(q)
response.body 

Any ideas or suggestions would be most appreciated.

Marked As Solved

jonatanklosko

jonatanklosko

Creator of Livebook

@fhunleth when the cell finishes evaluating, the output is blank for like 2s, and then “Output data no longer available, please reevaluate this cell” is shown, correct?

I tried calling Explorer.DataFrame.collect/1 on the results.

That actually makes sense. I believe the query returns a lazy dataframe, so if you call collect, it means the whole dataframe is in memory.

What happens is that when rendering the data table for the first time, the “table server” computes the first page for the table, but since the dataframe is lazy, it means it needs to download data, which takes more time. The Livebook client expects the initial data to arrive within 2s, otherwise it assumes the “table server” is dead and therefore shows “Output data no longer available”.

This is something that we can improve and it is actually already on my list : )

Also Liked

fhunleth

fhunleth

Co-author of Nerves

Hi @jonatanklosko. Thanks for the response!

What you’re saying sounds good. It takes about 10.6 seconds for the cell to evaluate and a small blank gap opens up below the cell. About 2 seconds later, I get the “Output data no longer available, please reevaluate this cell”. About 10 seconds after that, the table renders.

I didn’t think to grep Livebook for the the error message, but I totally see it now that you pointed me to it.

I’ve very glad to know this is on your list. I’m not in a rush for a fix, but if it helps for me to test this case, please let me know.

Thanks!

Where Next?

Popular in Questions Top

belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID&lt;0.412.0&gt; terminating ** (Postgrex.Error) FATAL...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
Codball
Mix format works fine if run from the cmd. I’ve followed this to facilitate the implementation into VSC which involves downloading an ext...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs &amp; Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
326 29600 154
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
AstonJ
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including. What is Phoenix LiveV...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement