protected function extractPaginationInfo(& $cql)
    {
        $words = explode(' ', $cql);
        $limit = 0;
        $offset = 0;
        $limitKey = null;
        foreach ($words as $key => $word) {
            if ('limit' === strtolower($word) && is_numeric($words[$key + 1])) {
                $limit = (int)$words[$key + 1];
                $limitKey = $key + 1;
            }
            if ('offset' === strtolower($word) && is_numeric($words[$key + 1])) {
                $offset = (int)$words[$key + 1];
                //Take out offset from CQL. It is not supported.
                unset($words[$key], $words[$key + 1]);
            }
        }

        //Offset is not supported by CQL. Therefore need to modify limit based on offset.
        //Adding offset to limit in order to fetch all available records.
        $limit += $offset;
        if ($limitKey !== null) {
            $words[$limitKey] = $limit;
        }
        $cql = implode(' ', $words);

        return ['limit' => $limit, 'offset' => $offset];
    }