我正在使用Kafka KSQL REST API进行查询(/query
),并且在响应中,我可以使用以下API访问结果列:https://docs.confluent.io/current/ksql/docs/developer-guide/api.html#run-a-query-and-stream-back-the-output
row.columns[i] (?) – The value contained in a single column for the row. The value type depends on the type of the column.
因此,我可以访问列值,而不是列名。
有什么办法可以访问列名,还是应该手动解析请求KSQL以从中提取列名?
例如,代替
[1524760769983,"1",1524760769747,"alice","home"]
我想得到{"columnA":1524760769983,"columnB":"1","columnC":1524760769747,"columnD":"alice","columnE":"home"]