fhunleth

fhunleth

Co-author of Nerves

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.

Showing Posts 1 to 3

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 : )

fhunleth

fhunleth OP

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!

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews