Hi.
In the SQL, you can just specify the `array_coordinates` type ARRAY[1]. For
example,
```
CREATE TABLE source(
`array_coordinates` ARRAY<ROW<`speed` STRING, ...>>
) WITH (
'format' = 'json'
)
```
[1]
https://nightlies.apache.org/flink/flink-docs-master/docs/connectors/table/formats/json/
Zain Haider Nemati <[email protected]> 于2022年5月21日周六 14:59写道:
> Hi Folks,
> I have data coming in this format:
>
> {
> “data”: {
> “oid__id”: “61de4f26f01131783f162453”,
> “array_coordinates”: “[ { \“speed\” : \“xxx\“, \“accuracy\” :
> \“xxx\“, \“bearing\” : \“xxx\“, \“altitude\” : \“xxx\“, \“longitude\” :
> \“xxx\“, \“latitude\” : \“xxx\“, \“dateTimeStamp\” : \“xxx\“, \“_id\” : {
> \“$oid\” : \“xxx\” } }, { \“speed\” : \“xxx\“, \“isFromMockProvider\” :
> \“false\“, \“accuracy\” : \“xxx\“, \“bearing\” : \“xxx\“, \“altitude\” :
> \“xxx\“, \“longitude\” : \“xxx\“, \“latitude\” : \“xxx\“, \“dateTimeStamp\”
> : \“xxx\“, \“_id\” : { \“$oid\” : \“xxx\” } }]“,
> “batchId”: “xxx",
> “agentId”: “xxx",
> “routeKey”: “40042-12-01-2022",
> “__v”: 0
> },
> “metadata”: {
> “timestamp”: “2022-05-02T18:49:52.619827Z”,
> “record-type”: “data”,
> “operation”: “load”,
> “partition-key-type”: “primary-key”,
> “schema-name”: “xxx”,
> “table-name”: “xxx”
> }
> }
>
> Where length of array coordinates array varies is not fixed in the source
> is their any way to define a json deserializer for this? If so would really
> appreciate if I can get some help on this
>