@Nonnull @Override
    public ResultIterator<SqlRow> iterator() {
        if (iterator == null) {
            iterator = new RowToSqlRowIterator(rootResultConsumer.iterator());

            return iterator;
        } else {
            throw new IllegalStateException("Iterator can be requested only once.");
        }
    }
@Test
    public void when_hasNextInterrupted_then_interrupted() {
        // this query is a continuous one, but never returns any rows (all are filtered out)
        SqlResult sqlResult = instance().getSql().execute("select * from table(generate_stream(1)) where v < 0");
        AtomicBoolean interruptedOk = new AtomicBoolean();
        Thread t = new Thread(() -> {
            try {
                sqlResult.iterator().hasNext();
            } catch (Throwable e) {
                if (e.getCause() instanceof RuntimeException
                        && e.getCause().getCause() instanceof InterruptedException) {
                    interruptedOk.set(true);
                } else {
                    logger.severe("Unexpected exception caught", e);
                }
            }
        });
        t.start();
        t.interrupt();
        assertTrueEventually(() -> assertTrue(interruptedOk.get()));
    }