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

pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
Kagamiiiii
Student &amp; New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
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
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
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
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
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
beno
I will often find my self writing things similar to: case some_value do nil -&gt; something() "" -&gt; something() _ -&gt; someth...
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

We're in Beta

About us Mission Statement