kgyrtkirk commented on a change in 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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to