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

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

                Author: ASF GitHub Bot
            Created on: 20/Feb/20 13:32
            Start Date: 20/Feb/20 13:32
    Worklog Time Spent: 10m 
      Work Description: kgyrtkirk commented on pull request #876: HIVE-22585: 
Clean up catalog/db/table name usage
URL: https://github.com/apache/hive/pull/876#discussion_r381998918
 
 

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/parse/HiveTableName.java
 ##########
 @@ -38,37 +38,22 @@ public HiveTableName(String catName, String dbName, String 
tableName) {
    * @throws SemanticException
    */
   public static TableName of(Table table) throws SemanticException {
-    return ofNullable(table.getTableName(), table.getDbName());
+    return ofNullable(table.getTableName(), table.getDbName()); // todo: this 
shouldn't call nullable
   }
 
   /**
-   * Set a @{@link Table} object's table and db names based on the provided 
string.
-   * @param dbTable the dbtable string
+   * Set a @{@link Table} object's table and db names based on the provided 
tableName object.
+   * @param tableName the tableName object
    * @param table the table to update
    * @return the table
    * @throws SemanticException
    */
-  public static Table setFrom(String dbTable, Table table) throws 
SemanticException{
-    TableName name = ofNullable(dbTable);
-    table.setTableName(name.getTable());
-    table.setDbName(name.getDb());
+  public static Table setFrom(TableName tableName, Table table) throws 
SemanticException{
 
 Review comment:
   this would be better served as an instance method - I guess it can't be 
added to Table...
   how abut something like `tableName.writeInto(table)`
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 389936)
    Time Spent: 50m  (was: 40m)

> Clean up catalog/db/table name usage
> ------------------------------------
>
>                 Key: HIVE-22585
>                 URL: https://issues.apache.org/jira/browse/HIVE-22585
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: David Lavati
>            Assignee: David Lavati
>            Priority: Major
>              Labels: pull-request-available, refactor
>         Attachments: HIVE-22585.01.patch, HIVE-22585.02.patch
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> This is a followup to HIVE-21198 to address some additional improvement ideas 
> for the TableName object mentioned inĀ 
> [https://github.com/apache/hive/pull/550] and attempt to remove all the fishy 
> usages of db/tablenames, as a number of places still rely on certain state 
> changes/black magic.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to