8000
Skip to content

SOAR对于having语句的rewrite处理聚合函数存在问题 #63

Description

@llzx373

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
cat having.sql|./soar.darwin-amd64 -rewrite-rules having -report-type rewrite
select * from x where count(1) > 2 group by t
cat having.sql
select * from x group by t having count(1)>2
  1. What did you expect to see?
cat having.sql|./soar.darwin-amd64 -rewrite-rules having -report-type rewrite
select * from x group by t having count(1)>2
  1. What did you see instead?
select * from x where count(1) > 2 group by t
  1. What version of are you using (soar -version)?

Version: 2018-10-29 22:39:22 +0800 @153c0c5
Branch: master
Compile: 2018-10-29 22:40:24 +0800 by go version go1.10.4 linux/amd64
GitDirty: 0

修复建议:

在having的rewrite组件,加入对聚合函数的检查,如果发现是聚合函数的条件,不做这个转化

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0