Skip to content

Hope the Map(String,Object) data type is expected to be officially compatible #30742

@frank-lam

Description

@frank-lam

I hope the Map(String,JsonObject) data type can be officially compatible, for example, my data is as follows:

{
    "apiVersion": "6.0",
    "version": "1.10.2",
    "deviceId": "16",
    "brand": "mobile",
    "deviceModel": "Mozilla/5.0 /4.0 Chrome/83.0.4103.106",
    "cpu": "",
    "resolution": "384*792",
    "uuid": "38bd9e54e1***42b5d3d0b7c",
    "eventId": "webrtc",
    "arg1": "usg_http_refreshToken",
    "arg2": "",
    "arg3": "944a846c2****6cca1d9c7d82d7",
    "args": {
        "url": "xxx.xxx.com/v1/usg/acs/token",
        "responseCode": "200",
        "isSuccess": true
    },
    "timestampTz": "2021-10-27 11:06:28.601 +0800"
}

In this scenario, the args field in my table can only be defined as String, select like: JSONExtractString(args, "url") / JSONExtractInt(args,"responseCode") / JSONExtractBool(args, "isSuccess"), but in SQL is not elegant, compared to Map type can use args['url'] way more succinctly, with presto we can get the fields directly like args.url / args.responseCode / args.isSuccess.
It is also unclear whether there is a significant difference between the performance of the JSONExtract* function with String type storage and the underlying performance of the Map type storage.
Expect official compatibility with JsonObject types, such data compatibility is the best.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions