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

Enhance the Prestodb python client to handle semicolon at the end of query #128

Open
ArinMathew opened this issue Jun 22, 2023 · 0 comments

Comments

@ArinMathew
Copy link

When we try a query like Select * from customer LIMIT 1; it returns error. It would have been better if we can handle from python client to process queries with and without semicolon so that it will not through any error.

Please find the error log attached below

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <prestodb.client.PrestoRequest object at 0x10d3b3d30>
http_response = <Response [200]>

    def process(self, http_response):
        # type: (requests.Response) -> PrestoStatus
        if not http_response.ok:
            self.raise_response_error(http_response)
    
        http_response.encoding = "utf-8"
        response = http_response.json()
        logger.debug("HTTP {}: {}".format(http_response.status_code, response))
        if "error" in response:
>           raise self._process_error(response["error"], response.get("id"))
E           prestodb.exceptions.PrestoUserError: PrestoUserError(type=USER_ERROR, name=SYNTAX_ERROR, message="line 1:31: mismatched input ';'. Expecting: <EOF>", query_id=20230428_083155_00223_3c582)

../venv/lib/python3.10/site-packages/prestodb/client.py:417: PrestoUserError
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