flinksql向kafka输出数据出现EXPR$7

刘超 3月前 ⋅ 557 阅读   编辑

一、描述

  flinksql1.7.0向kafka写数据,如果没指定别名,会生成如下数据

{"test":0,"publisher_id":"pub236088034304","app_id":"app496319027008","slot_id":"s910757818752","traffic_source":"1","bucket_id":"0","country_code":"NG","EXPR$7":1,"EXPR$8":1,"EXPR$9":0,"EXPR$10":1,"EXPR$11":0,"EXPR$12":0,"EXPR$13":0,"EXPR$14":0,"EXPR$15":0,"EXPR$16":0,"EXPR$17":0,"EXPR$18":1,"EXPR$19":0,"EXPR$20":0,"EXPR$21":0,"EXPR$22":0,"EXPR$23":0,"EXPR$24":0,"EXPR$25":0,"EXPR$26":0}

二、解决方法

  加上as别名,如下

  s"""select ${dmPlacementsDimensionGroupByCondition},
   sum(request_count) as request_count,....
   """


注意:本文归作者所有,未经作者允许,不得转载

全部评论: 0

    我有话说: