langchain_community.document_loaders.max_compute.MaxComputeLoader¶

class langchain_community.document_loaders.max_compute.MaxComputeLoader(query: str, api_wrapper: MaxComputeAPIWrapper, *, page_content_columns: Optional[Sequence[str]] = None, metadata_columns: Optional[Sequence[str]] = None)[source]¶

Load from Alibaba Cloud MaxCompute table.

Initialize Alibaba Cloud MaxCompute document loader.

Parameters
  • query – SQL query to execute.

  • api_wrapper – MaxCompute API wrapper.

  • page_content_columns – The columns to write into the page_content of the Document. If unspecified, all columns will be written to page_content.

  • metadata_columns – 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.

from_params(query, endpoint, project, *[, ...])

Convenience constructor that builds the MaxCompute API wrapper from

lazy_load()

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: Optional[Sequence[str]] = None, metadata_columns: Optional[Sequence[str]] = None)[source]¶

Initialize Alibaba Cloud MaxCompute document loader.

Parameters
  • query – SQL query to execute.

  • api_wrapper – MaxCompute API wrapper.

  • page_content_columns – The columns to write into the page_content of the Document. If unspecified, all columns will be written to page_content.

  • metadata_columns – The columns to write into the metadata of the Document. If unspecified, all columns not added to page_content will be written.

classmethod from_params(query: str, endpoint: str, project: str, *, access_id: Optional[str] = None, secret_access_key: Optional[str] = None, **kwargs: Any) MaxComputeLoader[source]¶
Convenience constructor that builds the MaxCompute API wrapper from

given parameters.

Parameters
  • query – SQL query to execute.

  • endpoint – MaxCompute endpoint.

  • project – A project is a basic organizational unit of MaxCompute, which is similar to a database.

  • access_id – MaxCompute access ID. Should be passed in directly or set as the environment variable MAX_COMPUTE_ACCESS_ID.

  • secret_access_key – MaxCompute secret access key. Should be passed in directly or set as the environment variable MAX_COMPUTE_SECRET_ACCESS_KEY.

lazy_load() Iterator[Document][source]¶

A lazy loader for Documents.

load() List[Document][source]¶

Load data into Document objects.

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.

Examples using MaxComputeLoader¶