Hi guys,
I'm trying to get all the results from a query but today I noticed that sometimes it wouldn't return all the rows. After reading the docs I understand that the data attribute from client.execute function can be called 2 or more times and that's why my code is wrong.
executePrestoQuery(query: string): Promise<any> {
return new Promise<any>((resolve, reject) => {
this.client.execute({
query: query,
catalog: "hive",
schema: "default",
source: "nodejs-client",
data: function (error, data, columns, stats) {
resolve(data);
},
success: function (error, stats, info) {
console.log("success");
},
error: function (error) {
reject(error);
},
});
});
}
So said that what's the best way to return all the data from the client.execute function? Can I return the data on the success attribute?
(Sorry If it's an easy solution I am new to Javascript)
Thank you
Guilherme
Hi guys,
I'm trying to get all the results from a query but today I noticed that sometimes it wouldn't return all the rows. After reading the docs I understand that the data attribute from client.execute function can be called 2 or more times and that's why my code is wrong.
So said that what's the best way to return all the data from the client.execute function? Can I return the data on the success attribute?
(Sorry If it's an easy solution I am new to Javascript)
Thank you
Guilherme