Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clickhosue不支持关键字 exist,这个解决起来有点麻烦了 #5

Open
qiujunlin opened this issue Aug 6, 2021 · 0 comments

Comments

@qiujunlin
Copy link
Owner

qiujunlin commented Aug 6, 2021

{    
    "User": {
        "id}{@": {
            "from": "Comment",
            "Comment": {
                "momentId": 15
            }
        }
    }
}

生成sql:SELECT * FROM `test`.`apijson_user` WHERE  (  ( EXISTS (SELECT * FROM `test`.`Comment` WHERE  (  (`momentId` = 15)  ) ) )  )  LIMIT 1

手动修改为如下后执行正确

SELECT * FROM `test`.`apijson_user` WHERE  15 in (  (SELECT `momentId` FROM `test`.`Comment`  ) )   LIMIT 1


执行错误:

cc.blynk.clickhouse.except.ClickHouseException: ClickHouse exception, code: 62, host: null, port: 0; Code: 62, e.displayText() = DB::Exception: Syntax error: failed at position 71 ('`test`'): `test`.`Comment` WHERE  (  (`momentId` = 15)  ) ) )  )  LIMIT 1 FORMAT TabSeparatedWithNamesAndTypes
. Expected one of: DoubleColon, LIKE, GLOBAL NOT IN, AS, DIV, IS, UUID, OR, QuestionMark, BETWEEN, NOT LIKE, MOD, AND, Comma, alias, IN, ILIKE, Dot, NOT ILIKE, NOT, token, NOT IN, GLOBAL IN (version 21.7.5.29 (official build))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant