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.

alazy_load()

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

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: 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]

async aload() β†’ List[Document]#

Load data into Document objects.

Return type:

List[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:

MaxComputeLoader

lazy_load() β†’ Iterator[Document][source]#

A lazy loader for Documents.

Return type:

Iterator[Document]

load() β†’ List[Document]#

Load data into Document objects.

Return type:

List[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