presto-kinesis/src/main/java/io/prestosql/plugin/kinesis/KinesisRecordSet.java/KinesisRecordCursor/getIterator
class KinesisRecordCursor:        private void getIterator()
                throws ResourceNotFoundException
        {
            GetShardIteratorRequest getShardIteratorRequest = new GetShardIteratorRequest();
            getShardIteratorRequest.setStreamName(split.getStreamName());
            getShardIteratorRequest.setShardId(split.getShardId());

            // Explanation: when we have a sequence number from a prior read or checkpoint, always use it.
            // Otherwise, decide if starting at a timestamp or the trim horizon based on configuration.
            // If starting at a timestamp, use the session variable STARTING_TIMESTAMP when given, otherwise
            // fallback on starting at STARTING_OFFSET_SECONDS from timestamp.
            if (lastReadSequenceNumber == null) {
                if (isIteratorFromTimestamp(session)) {
                    getShardIteratorRequest.setShardIteratorType("AT_TIMESTAMP");
                    long iteratorStartTimestamp = getIteratorStartTimestamp(session);
                    if (iteratorStartTimestamp == 0) {
                        long startTimestamp = System.currentTimeMillis() - (getIteratorOffsetSeconds(session) * 1000);
                        getShardIteratorRequest.setTimestamp(new Date(startTimestamp));
                    }
                    else {
                        getShardIteratorRequest.setTimestamp(new Date(iteratorStartTimestamp));
                    }
                }
                else {
                    getShardIteratorRequest.setShardIteratorType("TRIM_HORIZON");
                }
            }
            else {
                getShardIteratorRequest.setShardIteratorType("AFTER_SEQUENCE_NUMBER");
                getShardIteratorRequest.setStartingSequenceNumber(lastReadSequenceNumber);
            }

            GetShardIteratorResult getShardIteratorResult = clientManager.getClient().getShardIterator(getShardIteratorRequest);
            shardIterator = getShardIteratorResult.getShardIterator();
        }