[ 
https://issues.apache.org/jira/browse/HIVE-26171?focusedWorklogId=762170&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-762170
 ]

ASF GitHub Bot logged work on HIVE-26171:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Apr/22 08:28
            Start Date: 26/Apr/22 08:28
    Worklog Time Spent: 10m 
      Work Description: zhangbutao commented on PR #3238:
URL: https://github.com/apache/hive/pull/3238#issuecomment-1109504936

   > I think having a test would help preventing the situation when some change 
inadvertently reverts the fix. If writing a test is not prohibitively hard, I 
would suggest adding one, maybe with mocking the `DataConnectorProviderFactory` 
or something around that.
   
   > 
   
   @pvary Thanks for your suggestion. But i find it a little difficult to write 
this test. If mocking related class (`DataConnectorProviderFactory` or 
`IDataConnectorProvider`), we need add `powermock-api-mockito2` dependency to 
standalone-metastore moudle and I'm worried about the impact on existing tests. 
I also try add powermock dependency to mock test but found that metastore 
initializing not work well with `@RunWith(PowerMockRunner.class).`
   
   Because the added code snippet has been tested in `get_tables`(eg. 
`dataconnector_mysql.q` tested by mysql-docker), Could we skip the test here? 
or do you have a better way to test?  thx.




Issue Time Tracking
-------------------

    Worklog Id:     (was: 762170)
    Time Spent: 0.5h  (was: 20m)

> HMSHandler get_all_tables method can not retrieve tables from remote database
> -----------------------------------------------------------------------------
>
>                 Key: HIVE-26171
>                 URL: https://issues.apache.org/jira/browse/HIVE-26171
>             Project: Hive
>          Issue Type: Bug
>          Components: Standalone Metastore
>    Affects Versions: 4.0.0-alpha-1, 4.0.0-alpha-2
>            Reporter: zhangbutao
>            Assignee: zhangbutao
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 4.0.0-alpha-2
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> At present, get_all_tablesĀ  method in HMSHandler would not get table from 
> remote database. However, other component like presto and some jobs we 
> developed have used this api instead of _get_tables_ which could retrieve all 
> tables both native database and remote database .
> {code:java}
> // get_all_tables only can get tables from native database
> public List<String> get_all_tables(final String dbname) throws MetaException 
> {{code}
> {code:java}
> // get_tables can get tables from both native and remote database
> public List<String> get_tables(final String dbname, final String 
> pattern){code}
> I think we shoud fix get_all_tables to make it retrive tables from remote 
> database.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to