Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

JSONColumnsWithMetadata

输入 输出 别名

描述

JSONColumns 格式的不同之处在于,它还包含一些元数据和统计信息 (类似于 JSON 格式) 。

示例用法

示例:

{
        "meta":
        [
                {
                        "name": "num",
                        "type": "Int32"
                },
                {
                        "name": "str",
                        "type": "String"
                },

                {
                        "name": "arr",
                        "type": "Array(UInt8)"
                }
        ],

        "data":
        {
                "num": [42, 43, 44],
                "str": ["hello", "hello", "hello"],
                "arr": [[0,1], [0,1,2], [0,1,2,3]]
        },

        "rows": 3,

        "rows_before_limit_at_least": 3,

        "statistics":
        {
                "elapsed": 0.000272376,
                "rows_read": 3,
                "bytes_read": 24
        }
}

对于 JSONColumnsWithMetadata 输入格式,如果将设置 input_format_json_validate_types_from_metadata 设为 1, 则会比较输入数据元数据中的类型与表中对应列的类型。

格式设置

Navigation