Skip to main content
Glama
aliyun

Hologres MCP Server

Official
by aliyun

create_hg_maxcompute_foreign_table

Enable efficient querying of MaxCompute data by creating a foreign table in Hologres, specifying project, schema, and table details for seamless integration.

Instructions

Create a MaxCompute foreign table in Hologres database to accelerate queries on MaxCompute data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
local_schemaNoThe local schema name in Hologres (optional, default: 'public')public
maxcompute_projectYesThe MaxCompute project name (required)
maxcompute_schemaNoThe MaxCompute schema name (optional, default: 'default')default
maxcompute_tablesYesThe MaxCompute table names (required)

Implementation Reference

  • Executes the tool by validating inputs, constructing an IMPORT FOREIGN SCHEMA SQL statement to create MaxCompute foreign tables in Hologres, and passing it to handle_call_tool for execution.
    elif name == "create_hg_maxcompute_foreign_table": maxcompute_project = arguments.get("maxcompute_project") maxcompute_schema = arguments.get("maxcompute_schema", "default") maxcompute_tables = arguments.get("maxcompute_tables") local_schema = arguments.get("local_schema", "public") if not all([maxcompute_project, maxcompute_tables]): raise ValueError("maxcompute_project and maxcompute_tables are required") maxcompute_table_list = ", ".join(maxcompute_tables) # 修复 SQL 语句,确保正确拼接项目名称和 schema query = f""" IMPORT FOREIGN SCHEMA "{maxcompute_project}#{maxcompute_schema}" LIMIT TO ({maxcompute_table_list}) FROM SERVER odps_server INTO {local_schema}; """
  • Defines the input schema for the tool, specifying parameters like maxcompute_project, maxcompute_schema, maxcompute_tables, and local_schema with types, descriptions, defaults, and required fields.
    inputSchema={ "type": "object", "properties": { "maxcompute_project": { "type": "string", "description": "The MaxCompute project name (required)" }, "maxcompute_schema": { "type": "string", "default": "default", "description": "The MaxCompute schema name (optional, default: 'default')" }, "maxcompute_tables": { "type": "array", "items": { "type": "string" }, "description": "The MaxCompute table names (required)" }, "local_schema": { "type": "string", "default": "public", "description": "The local schema name in Hologres (optional, default: 'public')" } }, "required": ["maxcompute_project", "maxcompute_tables"] }
  • Registers the tool in the list_tools() function with its name, description, and input schema.
    Tool( name="create_hg_maxcompute_foreign_table", description="Create a MaxCompute foreign table in Hologres database to accelerate queries on MaxCompute data.", inputSchema={ "type": "object", "properties": { "maxcompute_project": { "type": "string", "description": "The MaxCompute project name (required)" }, "maxcompute_schema": { "type": "string", "default": "default", "description": "The MaxCompute schema name (optional, default: 'default')" }, "maxcompute_tables": { "type": "array", "items": { "type": "string" }, "description": "The MaxCompute table names (required)" }, "local_schema": { "type": "string", "default": "public", "description": "The local schema name in Hologres (optional, default: 'public')" } }, "required": ["maxcompute_project", "maxcompute_tables"] } ),

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aliyun/alibabacloud-hologres-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server