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

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
mgjohns61585
Could someone help me? I’m making my first elixir program, number guessing game. I can’t figure out how to convert the user’s guess from ...
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
nobody
How to bind a phoenix app to a specific ip address? could not find anything about that, nowhere, unfortunately, but for me this is quite...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

Other popular topics Top

TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41539 114
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30877 112
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 43622 214
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
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
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New

We're in Beta

About us Mission Statement