为什么header与TDengine数据库中taos shell和jdbc的查询结果不同

why header is different in query result with taos shell and jdbc in TDengine database

使用相同的查询,在 taos 中 shell 我得到的结果如下:

taos> select last(ts, c1) from db.stb where t0 = 'shanghai'\G;
*************************** 1.row ***************************
ts: 2020-10-01 00:00:09.999
c1: NFLxdQTArXRz88eZizveRdtcPgomSEl7XottIKO0LTKJEoKgRf2FVKp2AmYFpvtLqk311k
Query OK, 1 row(s) in set (0.006903s)

在 JDBC 中,我得到的结果如下:

[ OK ] Connection established. [ OK ] time cost: 110 ms, execute statement ====> select last(ts, c1) from db.stb where t0 = 'shanghai' last(ts): 2020-10-01 00:00:09.999 last(c1): NFLxdQTArXRz88eZizveRdtcPgomSEl7XottIKO0LTKJEoKgRf2FVKp2AmYFpvtLqk311k connection closed.

为什么相同查询的 header 不同?

header 名称可以在 /etc/taos/taos.cfg

中使用 keepColumnName 配置
# the last_row/first/last aggregator will not change the original column name in the result fields
keepColumnName            1