presto-jdbc/src/main/java/io/prestosql/jdbc/PrestoResultSet.java/PrestoResultSet/hasNext
class PrestoResultSet:        @Override
        public boolean hasNext()
        {
            if (!rowQueue.isEmpty()) {
                return true;
            }
            while (rowQueue.isEmpty() && !future.isDone()) {
                // making sure rowQueue has some records to process or return false
                if (parent.isInterrupted()) {
                    interrupt(new InterruptedException("parent thread interrupted"));
                }
            }
            if (future.isCompletedExceptionally()) {
                try {
                    future.get();
                }
                catch (InterruptedException e) {
                    interrupt(e);
                }
                catch (ExecutionException e) {
                    throwIfUnchecked(e.getCause());
                    throw new RuntimeException(e.getCause());
                }
            }
            return !rowQueue.isEmpty();
        }