MaxComputeLoader#
- class langchain_community.document_loaders.max_compute.MaxComputeLoader(query: str, api_wrapper: MaxComputeAPIWrapper, *, page_content_columns: Sequence[str] | None = None, metadata_columns: Sequence[str] | None = None)[source]#
Load from Alibaba Cloud MaxCompute table.
Initialize Alibaba Cloud MaxCompute document loader.
- Parameters:
query (str) β SQL query to execute.
api_wrapper (MaxComputeAPIWrapper) β MaxCompute API wrapper.
page_content_columns (Optional[Sequence[str]]) β The columns to write into the page_content of the Document. If unspecified, all columns will be written to page_content.
metadata_columns (Optional[Sequence[str]]) β The columns to write into the metadata of the Document. If unspecified, all columns not added to page_content will be written.
Methods
__init__
(query,Β api_wrapper,Β *[,Β ...])Initialize Alibaba Cloud MaxCompute document loader.
A lazy loader for Documents.
aload
()Load data into Document objects.
from_params
(query,Β endpoint,Β project,Β *[,Β ...])Convenience constructor that builds the MaxCompute API wrapper from
A lazy loader for Documents.
load
()Load data into Document objects.
load_and_split
([text_splitter])Load Documents and split into chunks.
- __init__(query: str, api_wrapper: MaxComputeAPIWrapper, *, page_content_columns: Sequence[str] | None = None, metadata_columns: Sequence[str] | None = None)[source]#
Initialize Alibaba Cloud MaxCompute document loader.
- Parameters:
query (str) β SQL query to execute.
api_wrapper (MaxComputeAPIWrapper) β MaxCompute API wrapper.
page_content_columns (Sequence[str] | None) β The columns to write into the page_content of the Document. If unspecified, all columns will be written to page_content.
metadata_columns (Sequence[str] | None) β The columns to write into the metadata of the Document. If unspecified, all columns not added to page_content will be written.
- async alazy_load() AsyncIterator[Document] #
A lazy loader for Documents.
- Return type:
AsyncIterator[Document]
- classmethod from_params(query: str, endpoint: str, project: str, *, access_id: str | None = None, secret_access_key: str | None = None, **kwargs: Any) MaxComputeLoader [source]#
- Convenience constructor that builds the MaxCompute API wrapper from
given parameters.
- Parameters:
query (str) β SQL query to execute.
endpoint (str) β MaxCompute endpoint.
project (str) β A project is a basic organizational unit of MaxCompute, which is similar to a database.
access_id (str | None) β MaxCompute access ID. Should be passed in directly or set as the environment variable MAX_COMPUTE_ACCESS_ID.
secret_access_key (str | None) β MaxCompute secret access key. Should be passed in directly or set as the environment variable MAX_COMPUTE_SECRET_ACCESS_KEY.
kwargs (Any) β
- Return type:
- lazy_load() Iterator[Document] [source]#
A lazy loader for Documents.
- Return type:
Iterator[Document]
- load_and_split(text_splitter: TextSplitter | None = None) List[Document] #
Load Documents and split into chunks. Chunks are returned as Documents.
Do not override this method. It should be considered to be deprecated!
- Parameters:
text_splitter (Optional[TextSplitter]) β TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.
- Returns:
List of Documents.
- Return type:
List[Document]
Examples using MaxComputeLoader