langchain_community.document_loaders.cassandra
.CassandraLoader¶
- class langchain_community.document_loaders.cassandra.CassandraLoader(table: ~typing.Optional[str] = None, session: ~typing.Optional[Session] = None, keyspace: ~typing.Optional[str] = None, query: ~typing.Optional[~typing.Union[str, Statement]] = None, page_content_mapper: ~typing.Callable[[~typing.Any], str] = <function default_page_content_mapper>, metadata_mapper: ~typing.Callable[[~typing.Any], dict] = <function CassandraLoader.<lambda>>, *, query_parameters: ~typing.Union[dict, ~typing.Sequence] = None, query_timeout: ~typing.Optional[float] = <object object>, query_trace: bool = False, query_custom_payload: dict = None, query_execution_profile: ~typing.Any = <object object>, query_paging_state: ~typing.Any = None, query_host: Host = None, query_execute_as: str = None)[source]¶
Document Loader for Apache Cassandra.
- Parameters
table – The table to load the data from. (do not use together with the query parameter)
session – The cassandra driver session. If not provided, the cassio resolved session will be used.
keyspace – The keyspace of the table. If not provided, the cassio resolved keyspace will be used.
query – The query used to load the data. (do not use together with the table parameter)
page_content_mapper – a function to convert a row to string page content.
query_parameters – The query parameters used when calling session.execute .
query_timeout – The query timeout used when calling session.execute .
query_custom_payload – The query custom_payload used when calling session.execute .
query_execution_profile – The query execution_profile used when calling session.execute .
query_host – The query host used when calling session.execute .
query_execute_as – The query execute_as used when calling session.execute .
Methods
__init__
([table, session, keyspace, query, ...])Document Loader for Apache Cassandra.
A lazy loader for Documents.
load
()Load data into Document objects.
load_and_split
([text_splitter])Load Documents and split into chunks.
- __init__(table: ~typing.Optional[str] = None, session: ~typing.Optional[Session] = None, keyspace: ~typing.Optional[str] = None, query: ~typing.Optional[~typing.Union[str, Statement]] = None, page_content_mapper: ~typing.Callable[[~typing.Any], str] = <function default_page_content_mapper>, metadata_mapper: ~typing.Callable[[~typing.Any], dict] = <function CassandraLoader.<lambda>>, *, query_parameters: ~typing.Union[dict, ~typing.Sequence] = None, query_timeout: ~typing.Optional[float] = <object object>, query_trace: bool = False, query_custom_payload: dict = None, query_execution_profile: ~typing.Any = <object object>, query_paging_state: ~typing.Any = None, query_host: Host = None, query_execute_as: str = None) None [source]¶
Document Loader for Apache Cassandra.
- Parameters
table – The table to load the data from. (do not use together with the query parameter)
session – The cassandra driver session. If not provided, the cassio resolved session will be used.
keyspace – The keyspace of the table. If not provided, the cassio resolved keyspace will be used.
query – The query used to load the data. (do not use together with the table parameter)
page_content_mapper – a function to convert a row to string page content.
query_parameters – The query parameters used when calling session.execute .
query_timeout – The query timeout used when calling session.execute .
query_custom_payload – The query custom_payload used when calling session.execute .
query_execution_profile – The query execution_profile used when calling session.execute .
query_host – The query host used when calling session.execute .
query_execute_as – The query execute_as used when calling session.execute .
- load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document] ¶
Load Documents and split into chunks. Chunks are returned as Documents.
- Parameters
text_splitter – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.
- Returns
List of Documents.