public function executeUpdate(
        Session $session,
        Transaction $transaction,
        $sql,
        array $options = []
    ) {
        $res = $this->execute($session, $sql, [
            'transactionId' => $transaction->id()
        ] + $options);

        // Iterate through the result to ensure we have query statistics available.
        iterator_to_array($res->rows());

        $stats = $res->stats();
        if (!$stats) {
            throw new \InvalidArgumentException(
                'Partitioned DML response missing stats, possible due to non-DML statement as input.'
            );
        }

        $statsItem = isset($options['statsItem'])
            ? $options['statsItem']
            : 'rowCountExact';

        return $stats[$statsItem];
    }