Return KTable中KSQL中的列名
Return column names in KSQL in KTable
我正在使用 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"]
我认为目前这不可能。我已将 #2364 记录为增强请求,因为我认为它很有价值。
我正在使用 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"]
我认为目前这不可能。我已将 #2364 记录为增强请求,因为我认为它很有价值。