I execute the instruction on the Livy server using the HTTP POST call localhost:8998/sessions/0/statements , with the following body
{ "code": "spark.sql(\"select * from test_table limit 10\")" }
I need an answer in the following format
(...) "data": { "application/json": "[ {"id": "123", "init_date": 1481649345, ...}, {"id": "133", "init_date": 1481649333, ...}, {"id": "155", "init_date": 1481642153, ...}, ]" } (...)
but i get
(...) "data": { "text/plain": "res0: org.apache.spark.sql.DataFrame = [id: string, init_date: timestamp ... 64 more fields]" } (...)
What version of toString() the data block.
Is there a way to return a data frame as JSON using Livy Server?
EDIT
A JIRA problem has been found that fixes the problem: https://issues.cloudera.org/browse/LIVY-72
In the comments, can we say that Livy does not support and does not support such a function?
source share