def run(
        self,
        query: str,
        fetch: str = "all",
        **kwargs: Any,
    ) -> Union[str, Sequence[Dict[str, Any]], ResultSet]:
        """Execute a CQL query and return the results."""
        clean_query = self._validate_cql(query, "SELECT")
        result = self._session.execute(clean_query, **kwargs)
        if fetch == "all":
            return list(result)
        elif fetch == "one":
            return result.one()._asdict() if result else {}
        elif fetch == "cursor":
            return result
        else:
            raise ValueError("Fetch parameter must be either 'one', 'all', or 'cursor'")
Execute a CQL query and return the results.
llama-index-integrations/tools/llama-index-tools-cassandra/llama_index/tools/cassandra/cassandra_database_wrapper.py