-
Notifications
You must be signed in to change notification settings - Fork 569
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
Introduce syntax tokenizer to correctly handle parentheses in INSERT INTO statement in batch prepare #1248
Conversation
Tim Brunko seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
actually it's #1247, don't know how to merge these my two issues |
@timmyb32r there is no need to merge them. One is issue report, second is PR. It's fine. Could you please update PR title and description so it reflects the changes? Also, please take a look on ClickHouse CLA agreement above. |
updated title. what can I also to do, to help my PR to became merged? |
First of all, thanks for your work. Your PR indeed solves the issue you raised in #1247. However, it introduces an additional level of complexity, which we would like to avoid as a part of the simple ClickHouse driver. The maintenance cost for this additional 2,5k LoC (I know most of it is auto-generated) is non-zero. Regex with simple string operations is smelly but does not require us to bring this logic into a language driver. The purpose of parsing columns is to expose more accessible API, not to bring entire SQL lexer logic. I'm sorry, but I need to refuse your PR. Here is a PR that fixes your issue: #1252 |
It's not smelly - it's a wrong mechanism for parsing queries (or maybe it's possible in this particular case, but by very complicated regex, not by the current one). This is correct clickhouse queries:
I've just checked:
Can you confirm, that this query will never be supported by this clickhouse-driver? |
Okay, if you don't want to include such big dependency - I understand that. But I still have to give users of my product good functionality. Then don't you mind, if I move in current code parsing query function in special function, and into driver it will be used via global variable on pkg-level, and I will override it in my code? It will looks like that:
and I will be on init() of my component assign to QueryAndColumnsExtractor field of clickhouse-go package my own parsing method, which will be based on code from my pr? Then users of driver clickhouse-go can got proper functionality with zero maintainance from driver maintainers? |
Summary
Checklist
Delete items not relevant to your PR: