-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Query wrongly gets appended "FORMAT TabSeparatedWithNamesAndTypes" #168
Comments
Well, we check for Why do we need add |
You only check it here https://github.com/xzkostyan/clickhouse-sqlalchemy/blob/master/clickhouse_sqlalchemy/drivers/http/connector.py#L112 but you don't check it here : https://github.com/xzkostyan/clickhouse-sqlalchemy/blob/master/clickhouse_sqlalchemy/drivers/http/base.py#L18 and I am pretty that for my sql code, this is where it wrongly gets appended. Also, kinda agree with your second statement, could this be clearly stated somewhere ? Before 0.1.6 I believe that you did need to add the Seems to me that the best would be to be robust to an already existing |
We have also hit this issue when trying to perform a |
Describe the bug
I have been using
clickhouse-sqlalchemy
for some time without any problem. Not sure exactly why, but I have always used my query with aFORMAT TabSeparatedWithNamesAndTypes
in the end, even though it was probably not necessary.I recently updated my package from
0.1.4
to0.2.0
and now i get the following error:After some investigation, it seems that the problem is that the query gets appended
FORMAT TabSeparatedWithNamesAndTypes
even though it's already there, and it's gets the driver unhappy to see this line twice. Some debugging made me believe the format string gets appended here : https://github.com/xzkostyan/clickhouse-sqlalchemy/blob/master/clickhouse_sqlalchemy/drivers/http/base.py#L18Is there a reason why we don't check if
FORMAT
is in the statement string here contrary to here https://github.com/xzkostyan/clickhouse-sqlalchemy/blob/master/clickhouse_sqlalchemy/drivers/http/connector.py#L112 ?I know that just removing this line from my queries makes the problem away so there's no urgency, but I thought you should know. No sure why it didn't trigger any error before also, maybe it happened and the parser did not raise Syntaxe error befor, I have not investigated with the former package versions
To Reproduce
Any query with
FORMAT TabSeparatedWithNamesAndTypes
should raise the error I believe.Expected behavior
Format suffix should not be appended here since it's already in the query.
Versions
0.2.0
3.9
The text was updated successfully, but these errors were encountered: