获取合并后的宽表。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求头

该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。

请求语法

POST /v4/openapi/assist/schema/actions/merge HTTP/1.1

请求参数

名称 类型 位置 是否必选 示例值 描述
spec String Query "opensearch.share.common"

目标版本规格(用于独享型特殊限制校验)。

默认:opensearch.share.common

参考:Quota 的 spec

请求体

字段

类型

是否必要

示例值

描述

tables

Object

表结构

indexes

Object

索引结构

返回数据

名称 类型 示例值 描述
requestId String ABCDEFGH

请求ID

result Struct

返回结果

fromTable Map -
mergeTable Map -
primaryKey String -

返回参数

名称

类型

描述

requestId

String

请求ID

result.mergeTable

Object

合并后的宽表结果

键为字段名,值为字段详情

字段详情参考:TableFields

result.fromTable

Object

源表信息

result.fromTable.tables

Object

表信息

键为表名,值为表结构信息

result.fromTable.tables.*

Object

键为字段名,值为字段详情

字段详情参考:TableFields

result.fromTable.master

String

主表

result.fromTable.level

Object

表层级信息,从0开始

键为表名,值为层级

result.fromTable.joinMap

Object

外表连接信息

键为表名,值为外表连接信息

result.fromTable.joinMap.*

Object

外表连接字段信息

键为字段,值为外表连接字段信息

参考:JoinMapFields

result.primaryKey

String

主键字段

TableFields

名称

类型

描述

name

String

字段名

type

String

字段类型

参考:数据表字段

isPk

String

是否为主键

0:否<br /r>1:是

isMulti

Integer

是否为多值

0:否<br /r>1:是

isAttribute

Integer

是否为属性字段

0:否<br /r>1:是

JoinMapFields

名称

类型

描述

table

String

外连表名

key

String

外连表主键名

join

Object

外连表的扩展字段

示例

请求示例

POST /v4/openapi/assist/schema/actions/merge HTTP/1.1

```
{
    "indexes": {
        "searchFields": {
            "default": {
                "fields": [
                    "title",
                    "js",
                    "infotags"
                ],
                "analyzer": "chn_standard"
            },
            "id": {
                "fields": [
                    "id"
                ]
            }
        },
        "filterFields": [
            "id",
            "classid"
        ]
    },
    "tables": {
        "phome_ecms_tuzhi": {
            "name": "phome_ecms_tuzhi",
            "fields": {
                "id": {
                    "name": "id",
                    "type": "INT",
                    "joinWith": [
                        "phome_ecms_tuzhi_data_1"
                    ],
                    "primaryKey": true
                },
                "classid": {
                    "name": "classid",
                    "type": "INT",
                    "primaryKey": false
                },
                "title": {
                    "name": "title",
                    "type": "TEXT",
                    "primaryKey": false
                },
                "js": {
                    "name": "js",
                    "type": "TEXT",
                    "primaryKey": false
                }
            },
            "primaryTable": true
        },
        "phome_ecms_tuzhi_data_1": {
            "name": "phome_ecms_tuzhi_data_1",
            "fields": {
                "id_1": {
                    "name": "id_1",
                    "type": "INT",
                    "primaryKey": true
                },
                "classid_1": {
                    "name": "classid_1",
                    "type": "INT",
                    "primaryKey": false
                },
                "infotags": {
                    "name": "infotags",
                    "type": "TEXT",
                    "primaryKey": false
                }
            },
            "primaryTable": false
        }
    }
}

正常返回示例

XML格式

<requestId>8EF9C2DF-34C3-EDCF-6DEA-0445EE53DA20</requestId>
<result>
    <mergeTable>
        <id>
            <name>id</name>
            <type>INT</type>
            <isPk>1</isPk>
            <isMulti>0</isMulti>
            <isAttribute>0</isAttribute>
        </id>
        <classid>
            <name>classid</name>
            <type>INT</type>
            <isPk>0</isPk>
            <isMulti>0</isMulti>
            <isAttribute>0</isAttribute>
        </classid>
        <title>
            <name>title</name>
            <type>TEXT</type>
            <isPk>0</isPk>
            <isMulti>0</isMulti>
            <isAttribute>0</isAttribute>
        </title>
        <js>
            <name>js</name>
            <type>TEXT</type>
            <isPk>0</isPk>
            <isMulti>0</isMulti>
            <isAttribute>0</isAttribute>
        </js>
        <classid_1>
            <name>classid_1</name>
            <type>INT</type>
            <isPk>0</isPk>
            <isMulti>0</isMulti>
            <isAttribute>0</isAttribute>
        </classid_1>
        <infotags>
            <name>infotags</name>
            <type>TEXT</type>
            <isPk>0</isPk>
            <isMulti>0</isMulti>
            <isAttribute>0</isAttribute>
        </infotags>
    </mergeTable>
    <fromTable>
        <tables>
            <phome_ecms_tuzhi>
                <id>
                    <name>id</name>
                    <type>INT</type>
                    <isPk>1</isPk>
                    <isMulti>0</isMulti>
                </id>
                <classid>
                    <name>classid</name>
                    <type>INT</type>
                    <isPk>0</isPk>
                    <isMulti>0</isMulti>
                </classid>
                <title>
                    <name>title</name>
                    <type>TEXT</type>
                    <isPk>0</isPk>
                    <isMulti>0</isMulti>
                </title>
                <js>
                    <name>js</name>
                    <type>TEXT</type>
                    <isPk>0</isPk>
                    <isMulti>0</isMulti>
                </js>
            </phome_ecms_tuzhi>
            <phome_ecms_tuzhi_data_1>
                <id_1>
                    <name>id_1</name>
                    <type>INT</type>
                    <isPk>1</isPk>
                    <isMulti>0</isMulti>
                </id_1>
                <classid_1>
                    <name>classid_1</name>
                    <type>INT</type>
                    <isPk>0</isPk>
                    <isMulti>0</isMulti>
                </classid_1>
                <infotags>
                    <name>infotags</name>
                    <type>TEXT</type>
                    <isPk>0</isPk>
                    <isMulti>0</isMulti>
                </infotags>
            </phome_ecms_tuzhi_data_1>
        </tables>
        <master>phome_ecms_tuzhi</master>
        <level>
            <phome_ecms_tuzhi>0</phome_ecms_tuzhi>
            <phome_ecms_tuzhi_data_1>1</phome_ecms_tuzhi_data_1>
        </level>
        <joinMap>
            <phome_ecms_tuzhi>
                <id>
                    <table>phome_ecms_tuzhi_data_1</table>
                    <key>id_1</key>
                    <join>
                        <classid_1>classid_1</classid_1>
                        <infotags>infotags</infotags>
                    </join>
                </id>
            </phome_ecms_tuzhi>
        </joinMap>
    </fromTable>
    <primaryKey>id</primaryKey>
</result>

JSON格式

{
    "requestId": "8EF9C2DF-34C3-EDCF-6DEA-0445EE53DA20",
    "result": {
        "mergeTable": {
            "id": {
                "name": "id",
                "type": "INT",
                "isPk": 1,
                "isMulti": 0,
                "isAttribute": 0
            },
            "classid": {
                "name": "classid",
                "type": "INT",
                "isPk": 0,
                "isMulti": 0,
                "isAttribute": 0
            },
            "title": {
                "name": "title",
                "type": "TEXT",
                "isPk": 0,
                "isMulti": 0,
                "isAttribute": 0
            },
            "js": {
                "name": "js",
                "type": "TEXT",
                "isPk": 0,
                "isMulti": 0,
                "isAttribute": 0
            },
            "classid_1": {
                "name": "classid_1",
                "type": "INT",
                "isPk": 0,
                "isMulti": 0,
                "isAttribute": 0
            },
            "infotags": {
                "name": "infotags",
                "type": "TEXT",
                "isPk": 0,
                "isMulti": 0,
                "isAttribute": 0
            }
        },
        "fromTable": {
            "tables": {
                "phome_ecms_tuzhi": {
                    "id": {
                        "name": "id",
                        "type": "INT",
                        "isPk": 1,
                        "isMulti": 0
                    },
                    "classid": {
                        "name": "classid",
                        "type": "INT",
                        "isPk": 0,
                        "isMulti": 0
                    },
                    "title": {
                        "name": "title",
                        "type": "TEXT",
                        "isPk": 0,
                        "isMulti": 0
                    },
                    "js": {
                        "name": "js",
                        "type": "TEXT",
                        "isPk": 0,
                        "isMulti": 0
                    }
                },
                "phome_ecms_tuzhi_data_1": {
                    "id_1": {
                        "name": "id_1",
                        "type": "INT",
                        "isPk": 1,
                        "isMulti": 0
                    },
                    "classid_1": {
                        "name": "classid_1",
                        "type": "INT",
                        "isPk": 0,
                        "isMulti": 0
                    },
                    "infotags": {
                        "name": "infotags",
                        "type": "TEXT",
                        "isPk": 0,
                        "isMulti": 0
                    }
                }
            },
            "master": "phome_ecms_tuzhi",
            "level": {
                "phome_ecms_tuzhi": 0,
                "phome_ecms_tuzhi_data_1": 1
            },
            "joinMap": {
                "phome_ecms_tuzhi": {
                    "id": {
                        "table": "phome_ecms_tuzhi_data_1",
                        "key": "id_1",
                        "join": {
                            "classid_1": "classid_1",
                            "infotags": "infotags"
                        }
                    }
                }
            }
        },
        "primaryKey": "id"
    }
}

错误码

访问错误中心查看更多错误码。