ashniku commented on PR #6371: URL: https://github.com/apache/hive/pull/6371#issuecomment-4114980377
> The `MetaStoreUtils#parseDbName` is called by many APIs in `HMSHandler` so a .q file is not the best way to test it. A unit test such as `TestMetaStoreUtils` would us allow us to test more complex scenarios/inputs and much faster. Below a few interesting edge cases: > > ``` > @ > @! > @# > @#db1 > @cat1 > @cat1# > @cat1#! > @cat1#@db1 > @cat1##db1 > @cat1#db1 > @cat1#db1! > @cat1! > #db1 > #! > # > ``` > > The qtest covers only `@cat1` use-case and the new code assumes that it designates the database `@cat1` in the `default` catalog. I don't have objections to adopt this assumption but let's add the above unit tests to: > > * document/establish expected behavior > * ensure we are not altering/breaking an existing use-case. > > In general, the `parseDbName` is brittle so HS2 (and new clients) should not rely in this method that is mainly there for backward compatibility. In other words, none of the CREATE/ALTER/DROP commands should hit `parseDbName` so the fact that we reach this point could also be considered a bug. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
