[Bug] Presto TABLE_NOT_FOUND returns lower case table name causing has_table regex to fail
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Search before asking
- [X] I have searched in the issues and found no similar issues.
Describe the bug
Issue migrated from https://github.com/dropbox/PyHive/issues/302
regex = r"Table\ \'.*{}\'\ does\ not\ exist".format(re.escape(table_name))
if msg and re.search(regex, msg):
raise exc.NoSuchTableError(table_name)
else:
raise
with presto and Oracle, Oracle has table name with upper case, but table name in error message which return from presto is with lower case, so re.search method will return None, then has_table method will exit with uncaught exception.
maybe we should use re.IGNORECASE in re.search method
Affects Version(s)
master (pyhive v0.7.0)
Kyuubi Server Log Output
No response
Kyuubi Engine Log Output
No response
Kyuubi Server Configurations
No response
Kyuubi Engine Configurations
No response
Additional context
No response
Are you willing to submit PR?
- [ ] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to fix.
- [X] No. I cannot submit a PR at this time.
Hello @tboddyspargo, Thanks for finding the time to report the issue! We really appreciate the community's efforts to improve Apache Kyuubi.
NOTE: A similar issue exists when connecting to databricks - the regex doesn't match the error message returned by the database for table not found (e.g .[TABLE_OR_VIEW_NOT_FOUND]).
Thanks for reporting this issue, @BruceWong96 do you have time to take a look at this issue?
Thanks for reporting this issue, @BruceWong96 do you have time to take a look at this issue?
Yes, I need some time to test it.
@BruceWong96 thank you in advance.
Hi, After testing, Presto did not correctly match "Table table_name does not exist" when linking to some engines that can contain uppercase letters in table names, such as Oracle. We can ignore case by adding re.IGNORECASE when matching. I also added UT in this PR.
PTAL. @pan3793
Thanks.
@pan3793 - Is this already part of a release on PyPI or do you know when we can expect this to be published in a release on PyPI?