code: async function executeAthenaQuery (athena, request, logging) {
  	let getResultsParams = await startQuery(athena, request, logging);
  	if (getResultsParams) {
  		let data;
  		let previousToken = null;
  		do {
  			if ((data) && (data.NextToken) && (data.NextToken !== previousToken)) {
  				previousToken = data.NextToken;
  				getResultsParams.NextToken = data.NextToken;
  			}
  			data = await getResults(athena, getResultsParams, request, logging);
  			if (request.isFormatJson()) {
  		 		outputJson(data, request.getOutput());
  			} else {
  		 		outputRaw(data, request.getOutput());
  			}
  		} while ((data) && (data.NextToken) && (data.NextToken !== previousToken));	
  	}
  }
docs: Internal/Util functions.