[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-19 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 19/Nov/19 09:57
Start Date: 19/Nov/19 09:57
Worklog Time Spent: 10m 
  Work Description: dlavati commented on issue #550: HIVE-21198 Introduce a 
database object reference class
URL: https://github.com/apache/hive/pull/550#issuecomment-555426283
 
 
   This got meged as 44697f0aa766a8329a599572013e9ba0a6750637. Thank you for 
the review, I'll include these in the followup.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 345879)
Time Spent: 4h 10m  (was: 4h)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.12.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch, HIVE-21198.5.patch, 
> HIVE-21198.6.patch, HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 4h 10m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-19 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 19/Nov/19 09:57
Start Date: 19/Nov/19 09:57
Worklog Time Spent: 10m 
  Work Description: dlavati commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550
 
 
   
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 345880)
Time Spent: 4h 20m  (was: 4h 10m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.12.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch, HIVE-21198.5.patch, 
> HIVE-21198.6.patch, HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 4h 20m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 22:55
Start Date: 12/Nov/19 22:55
Worklog Time Spent: 10m 
  Work Description: dlavati commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345489917
 
 

 ##
 File path: 
hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
 ##
 @@ -336,7 +336,7 @@ protected void 
authorizeDDLWork(HiveSemanticAnalyzerHookContext cntxt, Hive hive
 } else if (ddlDesc instanceof AlterTableSetLocationDesc) {
   AlterTableSetLocationDesc alterTable = 
(AlterTableSetLocationDesc)ddlDesc;
   Table table = hive.getTable(SessionState.get().getCurrentDatabase(),
-  Utilities.getDbTableName(alterTable.getTableName())[1], false);
+  Utilities.getDbTableName(alterTable.getDbTableName())[1], false);
 
 Review comment:
   I've marked it deprecated this time.
   Some places rely on some of the state changes from this, so killing it in 1 
patch would have been harder.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342259)
Time Spent: 4h  (was: 3h 50m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 4h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:26
Start Date: 12/Nov/19 21:26
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345401411
 
 

 ##
 File path: ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
 ##
 @@ -1127,139 +1127,142 @@ private void analyzeAlterTableLocation(ASTNode ast, 
String tableName, Map partSpec)
+  private void analyzeAlterTablePartMergeFiles(ASTNode ast, TableName 
tableName, Map partSpec)
   throws SemanticException {
 
 Path oldTblPartLoc = null;
 Path newTblPartLoc = null;
 Table tblObj = null;
 ListBucketingCtx lbCtx = null;
 
-try {
 
 Review comment:
   earlier ; all exceptions (including any Runtime ones) were repackaged as 
SemanticException; are we safe to remove this try?
   update: I've just checked that we don't really experience any changes big 
changes of this; Driver will catch it as a lasst resort
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342173)
Time Spent: 3h 50m  (was: 3h 40m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345446033
 
 

 ##
 File path: 
ql/src/test/results/clientpositive/encrypted/encryption_move_tbl.q.out
 ##
 @@ -109,8 +109,8 @@ POSTHOOK: query: SHOW TABLES
 POSTHOOK: type: SHOWTABLES
 POSTHOOK: Input: database:default
 src
-FAILED: SemanticException [Error 10001]: Table not found encrypted_table_n1
-FAILED: SemanticException [Error 10001]: Table not found encrypted_table_n1
+FAILED: SemanticException [Error 10001]: Table not found 
default.encrypted_table_n1
 
 Review comment:
   it's good to see that it's getting more consistend; but why do we see this 3 
times? :D 
   I don't fully understand whats going on hereFAILED during a 
clientpositive test...why is that okay? :dagger: 
   (this is clearly outside of the scope of this change)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342156)
Time Spent: 3.5h  (was: 3h 20m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345399636
 
 

 ##
 File path: ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
 ##
 @@ -897,10 +897,10 @@ private void analyzeAlterTableProps(String[] qualified, 
HashMap
   }
   // if table is being modified to be external we need to make sure 
existing table
   // doesn't have enabled constraint since constraints are disallowed with 
such tables
-  else if(entry.getKey().equals("external") && 
entry.getValue().equals("true")){
-if(hasConstraintsEnabled(qualified[1])){
+  else if (entry.getKey().equals("external") && 
entry.getValue().equals("true")) {
+if (hasConstraintsEnabled(tableName.getTable())) {
 
 Review comment:
   this seems fishy to me...I guess if we hit this line when we are issuing an 
alter on a table of different database; things might go south...or is there 
something I'm missing?
   (this is of course outside of the scope of this ticket)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342166)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345393971
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java
 ##
 @@ -1160,16 +1158,16 @@ protected static void processForeignKeys(String 
databaseName, String tableName,
 " The number of foreign key columns should be same as number of parent 
key columns "));
 }
 
-String[] parentDBTbl = getQualifiedTableName((ASTNode) 
child.getChild(ptIndex));
+final TableName parentTblName = getQualifiedTableName((ASTNode) 
child.getChild(ptIndex));
 for (int j = 0; j < child.getChild(fkIndex).getChildCount(); j++) {
   SQLForeignKey sqlForeignKey = new SQLForeignKey();
-  sqlForeignKey.setFktable_db(databaseName);
-  sqlForeignKey.setFktable_name(tableName);
+  sqlForeignKey.setFktable_db(tName.getDb());
+  sqlForeignKey.setFktable_name(tName.getTable());
   Tree fkgrandChild = child.getChild(fkIndex).getChild(j);
   checkColumnName(fkgrandChild.getText());
   
sqlForeignKey.setFkcolumn_name(unescapeIdentifier(fkgrandChild.getText().toLowerCase()));
-  sqlForeignKey.setPktable_db(parentDBTbl[0]);
-  sqlForeignKey.setPktable_name(parentDBTbl[1]);
+  sqlForeignKey.setPktable_db(parentTblName.getDb());
 
 Review comment:
   at some point we might want to consider changing the thrift as well?
   or we should leave that alone?
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342159)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345405314
 
 

 ##
 File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
 ##
 @@ -2296,16 +2297,16 @@ private void getMetaData(QB qb, ReadEntity parentInput)
 }
 if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVESTATSAUTOGATHER)) {
   // Add the table spec for the destination table.
-  qb.getParseInfo().addTableSpec(ts.tableName.toLowerCase(), ts);
+  
qb.getParseInfo().addTableSpec(ts.getTableName().getTable().toLowerCase(), ts);
 
 Review comment:
   I think this means that we are using only the table's name here; without 
database/etc qualificationthe patch  right now preserves the existing 
behaviour; but to be more correct: we should be using either TableName's fqdn 
toString - please open a followup; I suspect that this might cause incorrect 
behaviour as well; I also think that addTableSpec should accept TableName; and 
do this magic there instead of at every call site; I just seen another 
`[...].toLowerCase()` line repeated a few lines below
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342158)
Time Spent: 3.5h  (was: 3h 20m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345403274
 
 

 ##
 File path: ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
 ##
 @@ -2275,9 +2276,9 @@ private void getMetaData(QB qb, ReadEntity parentInput)
 // Whether we are using an acid compliant transaction manager has 
already been caught in
 // UpdateDeleteSemanticAnalyzer, so if we are updating or deleting 
and getting nonAcid
 // here, it means the table itself doesn't support it.
-throw new SemanticException(ErrorMsg.ACID_OP_ON_NONACID_TABLE, 
ts.tableName);
+throw new SemanticException(ErrorMsg.ACID_OP_ON_NONACID_TABLE, 
ts.getTableName().getTable());
 
 Review comment:
   we might want to consider reporting the fully qualified table references in 
exceptions; so that they are more precise (cn be done probably later)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342157)
Time Spent: 3.5h  (was: 3h 20m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345391449
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java
 ##
 @@ -394,48 +394,53 @@ public static String getUnescapedName(ASTNode 
tableOrColumnNode, String currentD
 if (tokenType == HiveParser.TOK_TABNAME) {
   // table node
   Map.Entry dbTablePair = 
getDbTableNamePair(tableOrColumnNode);
-  String dbName = dbTablePair.getKey();
-  String tableName = dbTablePair.getValue();
-  if (dbName != null){
-return dbName + "." + tableName;
 
 Review comment:
   it's good to see this going away! :)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342154)
Time Spent: 3h 20m  (was: 3h 10m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3h 20m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345441151
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/message/AddPrimaryKeyHandler.java
 ##
 @@ -53,16 +54,17 @@
   return tasks;
 }
 
-String actualDbName = context.isDbNameEmpty() ? pks.get(0).getTable_db() : 
context.dbName;
-String actualTblName = pks.get(0).getTable_name();
+final String actualDbName = context.isDbNameEmpty() ? 
pks.get(0).getTable_db() : context.dbName;
+final String actualTblName = pks.get(0).getTable_name();
+final TableName tName = TableName.fromString(actualTblName, null, 
actualDbName);
 
 Review comment:
   can we chane the order of the arguments of this method?
   cat, db, tblName instead (can be done in a followup)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342155)
Time Spent: 3.5h  (was: 3h 20m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3.5h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345401411
 
 

 ##
 File path: ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
 ##
 @@ -1127,139 +1127,142 @@ private void analyzeAlterTableLocation(ASTNode ast, 
String tableName, Map partSpec)
+  private void analyzeAlterTablePartMergeFiles(ASTNode ast, TableName 
tableName, Map partSpec)
   throws SemanticException {
 
 Path oldTblPartLoc = null;
 Path newTblPartLoc = null;
 Table tblObj = null;
 ListBucketingCtx lbCtx = null;
 
-try {
 
 Review comment:
   earlier ; all exceptions (including any Runtime ones) were repackaged as 
SemanticException; are we safe to remove this try?  
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342161)
Time Spent: 3h 40m  (was: 3.5h)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345446635
 
 

 ##
 File path: ql/src/test/results/clientpositive/input10.q.out
 ##
 @@ -21,7 +21,7 @@ STAGE DEPENDENCIES:
 STAGE PLANS:
   Stage: Stage-0
 Describe Table
-  table: TEST10
+  table: default.TEST10
 
 Review comment:
   :+1: 
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342160)
Time Spent: 3h 40m  (was: 3.5h)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345441875
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/load/message/RenameTableHandler.java
 ##
 @@ -55,18 +55,19 @@
 }
   }
 
-  String oldName = StatsUtils.getFullyQualifiedTableName(oldDbName, 
tableObjBefore.getTableName());
-  String newName = StatsUtils.getFullyQualifiedTableName(newDbName, 
tableObjAfter.getTableName());
+  TableName oldName = TableName.fromString(tableObjBefore.getTableName(), 
null, oldDbName);
+  TableName newName = TableName.fromString(tableObjAfter.getTableName(), 
null, newDbName);
   ReplicationSpec replicationSpec = context.eventOnlyReplicationSpec();
   if (ReplUtils.isTableMigratingToTransactional(context.hiveConf, 
tableObjAfter)) {
 replicationSpec.setMigratingToTxnTable();
   }
-  AlterTableRenameDesc renameTableDesc = new AlterTableRenameDesc(oldName, 
replicationSpec, false, newName);
+  AlterTableRenameDesc renameTableDesc =
+  new AlterTableRenameDesc(oldName, replicationSpec, false, 
newName.getNotEmptyDbTable());
 
 Review comment:
   the newName is passed as string; while oldName is a TableName (ok in a 
followup as well)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342162)
Time Spent: 3h 40m  (was: 3.5h)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345443647
 
 

 ##
 File path: ql/src/test/results/clientnegative/delete_non_acid_table.q.out
 ##
 @@ -34,4 +34,4 @@ POSTHOOK: Input: default@not_an_acid_table2
 -10708830710ruyd6Y50JpdGRf6HqD
 -1070551679iUR3Q
 -1069736047k17Am8uPHWk02cEf1jet
-FAILED: SemanticException [Error 10297]: Attempt to do update or delete on 
table default.not_an_acid_table2 that is not transactional
+FAILED: SemanticException [Error 10297]: Attempt to do update or delete on 
table not_an_acid_table2 that is not transactional
 
 Review comment:
   we are loosing the qualified database name from the exception; I think this 
should be made consistent; to show it everywhere - I'm not sure about if we 
should be also showing the catalog name or not... but if we do; we should "try" 
to be consistent about that as well
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342163)
Time Spent: 3h 40m  (was: 3.5h)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345449867
 
 

 ##
 File path: storage-api/src/java/org/apache/hadoop/hive/common/TableName.java
 ##
 @@ -86,36 +101,55 @@ public String getTable() {
 
   /**
* Get the name in db.table format, for use with stuff not yet converted to 
use the catalog.
+   * Fair warning, that if the db is null, this will return null.tableName
+   * @deprecated use {@link #getNotEmptyDbTable()} instead.
*/
+  // to be @Deprecated
   public String getDbTable() {
 return db + DatabaseName.CAT_DB_TABLE_SEPARATOR + table;
+  }
+
+  /**
+   * Get the name in `db`.`table` escaped format, if db is not empty, 
otherwise pass only the table name.
+   */
+  public String getEscapedNotEmptyDbTable() {
 
 Review comment:
   I think these escaper things should live in the exec side; aren't they only 
used during unparsing around there?
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342165)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:21
Start Date: 12/Nov/19 21:21
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345448803
 
 

 ##
 File path: storage-api/src/java/org/apache/hadoop/hive/common/TableName.java
 ##
 @@ -17,34 +17,45 @@
  */
 package org.apache.hadoop.hive.common;
 
+import java.io.Serializable;
+import java.util.Objects;
+
 /**
  * A container for a fully qualified table name, i.e. 
catalogname.databasename.tablename.  Also
  * includes utilities for string parsing.
  */
-public class TableName {
+public class TableName implements Serializable {
+
+  private static final long serialVersionUID = 1L;
+
+  /** Exception message thrown. */
+  private static final String ILL_ARG_EXCEPTION_MSG =
 
 Review comment:
   I don't  really see the benefit of making this a static final string;
   but anyway - I think the end goal is to stop the usage of any `tableName` 
which contains `dbname` or any other stuff...and in that case the method in 
which this is used should go away at some point - am I right?
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342164)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3h 40m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-12 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 12/Nov/19 21:20
Start Date: 12/Nov/19 21:20
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r345389350
 
 

 ##
 File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
 ##
 @@ -1085,7 +1086,7 @@ public void createTable(Table tbl, boolean ifNotExists,
 List checkConstraints)
 throws HiveException {
 try {
-  if (tbl.getDbName() == null || "".equals(tbl.getDbName().trim())) {
+  if (org.apache.commons.lang3.StringUtils.isBlank(tbl.getDbName())) {
 
 Review comment:
   oh my we are using lang3.StringUtils, lang.StringUtils; 
hadoop.common.StringUtils and hadoop.util.StringUtils
   might be worth trying to use less ...
   (can be fixed in next patch...this is not cruical)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 342153)
Time Spent: 3h 10m  (was: 3h)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.11.patch, HIVE-21198.2.patch, HIVE-21198.3.patch, 
> HIVE-21198.4.patch, HIVE-21198.5.patch, HIVE-21198.6.patch, 
> HIVE-21198.7.patch, HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-08 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 08/Nov/19 10:32
Start Date: 08/Nov/19 10:32
Worklog Time Spent: 10m 
  Work Description: dlavati commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r344111601
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/AbstractAlterTableDesc.java
 ##
 @@ -62,8 +62,8 @@ public AlterTableType getType() {
   }
 
   @Explain(displayName = "table name", explainLevels = { Level.USER, 
Level.DEFAULT, Level.EXTENDED })
-  public String getTableName() {
-return tableName;
+  public String getDbTableName() {
 
 Review comment:
   Currently the 2 methods are returning the same value, however one adds an 
explain, while the other is inherited and is used in e.g. 
`Driver:acquireLocks()`. I'd say these are 2 separate use cases (e.g. I 
wouldn't want `acquireLocks` to generate that much output with the explain), so 
I'd rather just rename one of them to make it more self-explanatory.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 340429)
Time Spent: 3h  (was: 2h 50m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.2.patch, HIVE-21198.3.patch, HIVE-21198.4.patch, 
> HIVE-21198.5.patch, HIVE-21198.6.patch, HIVE-21198.7.patch, 
> HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 3h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-08 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 08/Nov/19 10:24
Start Date: 08/Nov/19 10:24
Worklog Time Spent: 10m 
  Work Description: dlavati commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r344107895
 
 

 ##
 File path: 
metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreUtils.java
 ##
 @@ -154,7 +154,7 @@ static public Deserializer getDeserializer(Configuration 
conf,
 ObjectInspector oi = deserializer.getObjectInspector();
 String[] names = tableName.split("\\.");
 String last_name = names[names.length - 1];
-for (int i = 1; i < names.length; i++) {
+for (int i = 2; i < names.length; i++) {
 
 Review comment:
   This used to split e.g. `mytable.field1`, however now we're always passing 
`mydb.mytable.field1`. I can leave a comment to clarify this.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 340425)
Time Spent: 2h 50m  (was: 2h 40m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.2.patch, HIVE-21198.3.patch, HIVE-21198.4.patch, 
> HIVE-21198.5.patch, HIVE-21198.6.patch, HIVE-21198.7.patch, 
> HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-06 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 06/Nov/19 16:43
Start Date: 06/Nov/19 16:43
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r343195426
 
 

 ##
 File path: 
hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
 ##
 @@ -336,7 +336,7 @@ protected void 
authorizeDDLWork(HiveSemanticAnalyzerHookContext cntxt, Hive hive
 } else if (ddlDesc instanceof AlterTableSetLocationDesc) {
   AlterTableSetLocationDesc alterTable = 
(AlterTableSetLocationDesc)ddlDesc;
   Table table = hive.getTable(SessionState.get().getCurrentDatabase(),
-  Utilities.getDbTableName(alterTable.getTableName())[1], false);
+  Utilities.getDbTableName(alterTable.getDbTableName())[1], false);
 
 Review comment:
   I think we might want to mark Utilities.getDbTableName as deprecated or 
:dagger: it
   can be done in a followup as well
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 339473)
Time Spent: 2.5h  (was: 2h 20m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.2.patch, HIVE-21198.3.patch, HIVE-21198.4.patch, 
> HIVE-21198.5.patch, HIVE-21198.6.patch, HIVE-21198.7.patch, 
> HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-06 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 06/Nov/19 16:43
Start Date: 06/Nov/19 16:43
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r343204479
 
 

 ##
 File path: ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
 ##
 @@ -1331,6 +1331,21 @@ public Table getTable(final String dbName, final String 
tableName) throws HiveEx
 }
   }
 
+  /**
+   * Returns metadata of the table
+   *
+   * @param tableName
+   *  the tableName object
+   * @return the table
+   * @exception HiveException
+   *  if there's an internal error or if the table doesn't exist
+   */
+  public Table getTable(TableName tableName) throws HiveException {
+
+return tableName.getDb() == null ? this.getTable(tableName.getTable(), 
true) : this
 
 Review comment:
   a table without db is not invalid? is it only needed temporarilt - until 
this whole thing is done?
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 339476)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.2.patch, HIVE-21198.3.patch, HIVE-21198.4.patch, 
> HIVE-21198.5.patch, HIVE-21198.6.patch, HIVE-21198.7.patch, 
> HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-06 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 06/Nov/19 16:43
Start Date: 06/Nov/19 16:43
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r343199404
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/AbstractAlterTableDesc.java
 ##
 @@ -62,8 +62,8 @@ public AlterTableType getType() {
   }
 
   @Explain(displayName = "table name", explainLevels = { Level.USER, 
Level.DEFAULT, Level.EXTENDED })
-  public String getTableName() {
-return tableName;
+  public String getDbTableName() {
 
 Review comment:
   in this file we have "FullTableName" and "DbTableName" - I think it would 
help to define what is what in the TableName class or something; and the (try) 
to use the same concepts consequently  (of course this can be done later as 
well)
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 339474)
Time Spent: 2.5h  (was: 2h 20m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.2.patch, HIVE-21198.3.patch, HIVE-21198.4.patch, 
> HIVE-21198.5.patch, HIVE-21198.6.patch, HIVE-21198.7.patch, 
> HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-06 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 06/Nov/19 16:43
Start Date: 06/Nov/19 16:43
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r343202348
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/misc/TruncateTableDesc.java
 ##
 @@ -39,8 +39,7 @@
 public class TruncateTableDesc implements DDLDescWithWriteId, Serializable {
   private static final long serialVersionUID = 1L;
 
-  private final String tableName;
-  private final String fullTableName;
 
 Review comment:
   yeah...this seems to be one place where this tablename git confusing ... 
:+1: 
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 339472)
Time Spent: 2h 20m  (was: 2h 10m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.2.patch, HIVE-21198.3.patch, HIVE-21198.4.patch, 
> HIVE-21198.5.patch, HIVE-21198.6.patch, HIVE-21198.7.patch, 
> HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-06 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 06/Nov/19 16:43
Start Date: 06/Nov/19 16:43
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r343195724
 
 

 ##
 File path: 
hcatalog/core/src/test/java/org/apache/hive/hcatalog/cli/TestSemanticAnalysis.java
 ##
 @@ -403,7 +403,7 @@ public void testCTLPass() throws Exception {
 query = "create table like_table like junit_sem_analysis";
 hcatDriver.run(query);
 //Table tbl = client.getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, 
likeTbl);
-//assertEquals(likeTbl,tbl.getTableName());
+//assertEquals(likeTbl,tbl.getDbTableName());
 
 Review comment:
   :rofl: 
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 339477)
Time Spent: 2h 40m  (was: 2.5h)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.2.patch, HIVE-21198.3.patch, HIVE-21198.4.patch, 
> HIVE-21198.5.patch, HIVE-21198.6.patch, HIVE-21198.7.patch, 
> HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-11-06 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 06/Nov/19 16:43
Start Date: 06/Nov/19 16:43
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r343197173
 
 

 ##
 File path: 
metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStoreUtils.java
 ##
 @@ -154,7 +154,7 @@ static public Deserializer getDeserializer(Configuration 
conf,
 ObjectInspector oi = deserializer.getObjectInspector();
 String[] names = tableName.split("\\.");
 String last_name = names[names.length - 1];
-for (int i = 1; i < names.length; i++) {
+for (int i = 2; i < names.length; i++) {
 
 Review comment:
   I'm not sure what's happening here ; but this =1  / =2 looks wierd 
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 339475)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.10.patch, 
> HIVE-21198.2.patch, HIVE-21198.3.patch, HIVE-21198.4.patch, 
> HIVE-21198.5.patch, HIVE-21198.6.patch, HIVE-21198.7.patch, 
> HIVE-21198.8.patch, HIVE-21198.9.patch
>
>  Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



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


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-04-18 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 18/Apr/19 13:48
Start Date: 18/Apr/19 13:48
Worklog Time Spent: 10m 
  Work Description: dlavati-hw commented on issue #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#issuecomment-484516822
 
 
   The amount of possible refactors is a lot bigger then comfortable in 1 
issue, so I'm reducing the scope for this and opened HIVE-21630 as an umbrella 
ticket.
 

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:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 229686)
Time Spent: 2h 10m  (was: 2h)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch, HIVE-21198.5.patch
>
>  Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-27 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 27/Feb/19 16:27
Start Date: 27/Feb/19 16:27
Worklog Time Spent: 10m 
  Work Description: dlavati commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260830699
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/incremental/IncrementalLoadTasksBuilder.java
 ##
 @@ -266,16 +271,15 @@ private boolean shouldReplayEvent(FileStatus dir, 
DumpType dumpType, String dbNa
 return updateReplIdTxnTask;
   }
 
-  private Task tableUpdateReplStateTask(String dbName, 
String tableName,
-Map 
partSpec, String replState,
-Task preCursor) throws SemanticException {
+  private Task tableUpdateReplStateTask(TableName 
tableName, Map partSpec,
 
 Review comment:
   Besides a greater level of enforcement, is there any other benefit?
   Inside `org.apache.hadoop.hive.ql.plan` only `ShowLocksDesc` is using both 
tableName, dbName and partitionspec, the other Desc classes that have 
partitionspec only use tableName.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 205237)
Time Spent: 2h  (was: 1h 50m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 2h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-27 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 27/Feb/19 16:08
Start Date: 27/Feb/19 16:08
Worklog Time Spent: 10m 
  Work Description: dlavati-hw commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260821879
 
 

 ##
 File path: 
hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
 ##
 @@ -348,8 +348,8 @@ protected void 
authorizeDDLWork(HiveSemanticAnalyzerHookContext cntxt, Hive hive
 
 AlterTableDesc alterTable = work.getAlterTblDesc();
 if (alterTable != null) {
-  Table table = hive.getTable(SessionState.get().getCurrentDatabase(),
-  Utilities.getDbTableName(alterTable.getOldName())[1], false);
+  final String tableName = 
Utilities.getTableName(alterTable.getOldName()).getTable();
+  Table table = hive.getTable(SessionState.get().getCurrentDatabase(), 
tableName, false);
 
 Review comment:
   Do you mean we should refactor getTable(String, String) to 
getTable(TableName)?
   We can try it, but it does mean an additional change of 80 usages.
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 205226)
Time Spent: 1h 50m  (was: 1h 40m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-26 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 26/Feb/19 12:11
Start Date: 26/Feb/19 12:11
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260254184
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/cache/results/QueryResultsCache.java
 ##
 @@ -651,7 +652,7 @@ public void notifyTableChanged(String dbName, String 
tableName, long updateTime)
 List entriesToInvalidate = null;
 rwLock.writeLock().lock();
 try {
-  String key = (dbName.toLowerCase() + "." + tableName.toLowerCase());
+  String key = TableName.getDbTable(dbName, tableName).toLowerCase();
 
 Review comment:
   I would think that at this point we should already have a tablename from 
somewhere; constructing it here doesn't really make sense
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 204216)
Time Spent: 20m  (was: 10m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-26 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 26/Feb/19 12:11
Start Date: 26/Feb/19 12:11
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260256192
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/incremental/IncrementalLoadTasksBuilder.java
 ##
 @@ -266,16 +271,15 @@ private boolean shouldReplayEvent(FileStatus dir, 
DumpType dumpType, String dbNa
 return updateReplIdTxnTask;
   }
 
-  private Task tableUpdateReplStateTask(String dbName, 
String tableName,
-Map 
partSpec, String replState,
-Task preCursor) throws SemanticException {
+  private Task tableUpdateReplStateTask(TableName 
tableName, Map partSpec,
 
 Review comment:
   now that I see this...I think that it would probably make sense to also 
include `partSpec` into this object
   (`PartishRef`: `catalog,database,tablename,partitonspec` ) ?
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 204225)
Time Spent: 1h 40m  (was: 1.5h)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-26 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 26/Feb/19 12:11
Start Date: 26/Feb/19 12:11
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260254184
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/cache/results/QueryResultsCache.java
 ##
 @@ -651,7 +652,7 @@ public void notifyTableChanged(String dbName, String 
tableName, long updateTime)
 List entriesToInvalidate = null;
 rwLock.writeLock().lock();
 try {
-  String key = (dbName.toLowerCase() + "." + tableName.toLowerCase());
+  String key = TableName.getDbTable(dbName, tableName).toLowerCase();
 
 Review comment:
   I would think that at this point we should already have a tablename from 
somewhere; constructing it here doesn't really make sense
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 204223)
Time Spent: 1h 20m  (was: 1h 10m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-26 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 26/Feb/19 12:11
Start Date: 26/Feb/19 12:11
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260253836
 
 

 ##
 File path: 
hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
 ##
 @@ -348,8 +348,8 @@ protected void 
authorizeDDLWork(HiveSemanticAnalyzerHookContext cntxt, Hive hive
 
 AlterTableDesc alterTable = work.getAlterTblDesc();
 if (alterTable != null) {
-  Table table = hive.getTable(SessionState.get().getCurrentDatabase(),
-  Utilities.getDbTableName(alterTable.getOldName())[1], false);
+  final String tableName = 
Utilities.getTableName(alterTable.getOldName()).getTable();
+  Table table = hive.getTable(SessionState.get().getCurrentDatabase(), 
tableName, false);
 
 Review comment:
   `TableName` contains the database name; 
`SessionState.get().getCurrentDatabase()` should appear only at the time of 
creating the `TableName` - so as a sideeffect this "getTable()" will expect 
`TableName` argument
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

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

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-26 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 26/Feb/19 12:11
Start Date: 26/Feb/19 12:11
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260254455
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/ColumnStatsUpdateTask.java
 ##
 @@ -86,8 +86,8 @@ private ColumnStatistics constructColumnStatsFromInput()
   colStats.getStatsDesc().getTableName());
   return colStats;
 }
-String dbName = work.dbName();
-String tableName = work.getTableName();
+final String dbName = work.dbName();
 
 Review comment:
   the "work" should have method(and corresponding field) `getTableName` 
instead of these 2 getters 
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 204222)
Time Spent: 1h 10m  (was: 1h)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-26 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 26/Feb/19 12:11
Start Date: 26/Feb/19 12:11
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260253361
 
 

 ##
 File path: 
hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
 ##
 @@ -348,8 +348,8 @@ protected void 
authorizeDDLWork(HiveSemanticAnalyzerHookContext cntxt, Hive hive
 
 AlterTableDesc alterTable = work.getAlterTblDesc();
 if (alterTable != null) {
-  Table table = hive.getTable(SessionState.get().getCurrentDatabase(),
-  Utilities.getDbTableName(alterTable.getOldName())[1], false);
+  final String tableName = 
Utilities.getTableName(alterTable.getOldName()).getTable();
 
 Review comment:
   I guess we can't add `of` methods to `TableName`; but I feel like putting 
this into "Utilities" is kinda unfortunate.
   How about: `HiveTableName.of(...)`
   If you need any utilities you can probably make HiveTableName extend 
TableName - not sure if that will be needed or not
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 204224)
Time Spent: 1.5h  (was: 1h 20m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-26 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 26/Feb/19 12:11
Start Date: 26/Feb/19 12:11
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260254455
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/ColumnStatsUpdateTask.java
 ##
 @@ -86,8 +86,8 @@ private ColumnStatistics constructColumnStatsFromInput()
   colStats.getStatsDesc().getTableName());
   return colStats;
 }
-String dbName = work.dbName();
-String tableName = work.getTableName();
+final String dbName = work.dbName();
 
 Review comment:
   the "work" should have method(and corresponding field) `getTableName` 
instead of these 2 getters 
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

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

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-26 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 26/Feb/19 12:11
Start Date: 26/Feb/19 12:11
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260253361
 
 

 ##
 File path: 
hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
 ##
 @@ -348,8 +348,8 @@ protected void 
authorizeDDLWork(HiveSemanticAnalyzerHookContext cntxt, Hive hive
 
 AlterTableDesc alterTable = work.getAlterTblDesc();
 if (alterTable != null) {
-  Table table = hive.getTable(SessionState.get().getCurrentDatabase(),
-  Utilities.getDbTableName(alterTable.getOldName())[1], false);
+  final String tableName = 
Utilities.getTableName(alterTable.getOldName()).getTable();
 
 Review comment:
   I guess we can't add `of` methods to `TableName`; but I feel like putting 
this into "Utilities" is kinda unfortunate.
   How about: `HiveTableName.of(...)`
   If you need any utilities you can probably make HiveTableName extend 
TableName - not sure if that will be needed or not
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

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

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 50m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-26 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 26/Feb/19 12:11
Start Date: 26/Feb/19 12:11
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260256192
 
 

 ##
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/exec/repl/incremental/IncrementalLoadTasksBuilder.java
 ##
 @@ -266,16 +271,15 @@ private boolean shouldReplayEvent(FileStatus dir, 
DumpType dumpType, String dbNa
 return updateReplIdTxnTask;
   }
 
-  private Task tableUpdateReplStateTask(String dbName, 
String tableName,
-Map 
partSpec, String replState,
-Task preCursor) throws SemanticException {
+  private Task tableUpdateReplStateTask(TableName 
tableName, Map partSpec,
 
 Review comment:
   now that I see this...I think that it would probably make sense to also 
include `partSpec` into this object
   (`PartishRef`: `catalog,database,tablename,partitonspec` ) ?
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 204218)
Time Spent: 40m  (was: 0.5h)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 40m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-26 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 26/Feb/19 12:11
Start Date: 26/Feb/19 12:11
Worklog Time Spent: 10m 
  Work Description: kgyrtkirk commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550#discussion_r260253836
 
 

 ##
 File path: 
hcatalog/core/src/main/java/org/apache/hive/hcatalog/cli/SemanticAnalysis/HCatSemanticAnalyzer.java
 ##
 @@ -348,8 +348,8 @@ protected void 
authorizeDDLWork(HiveSemanticAnalyzerHookContext cntxt, Hive hive
 
 AlterTableDesc alterTable = work.getAlterTblDesc();
 if (alterTable != null) {
-  Table table = hive.getTable(SessionState.get().getCurrentDatabase(),
-  Utilities.getDbTableName(alterTable.getOldName())[1], false);
+  final String tableName = 
Utilities.getTableName(alterTable.getOldName()).getTable();
+  Table table = hive.getTable(SessionState.get().getCurrentDatabase(), 
tableName, false);
 
 Review comment:
   `TableName` contains the database name; 
`SessionState.get().getCurrentDatabase()` should appear only at the time of 
creating the `TableName` - so as a sideeffect this "getTable()" will expect 
`TableName` argument
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 204221)
Time Spent: 1h  (was: 50m)

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Work logged] (HIVE-21198) Introduce a database object reference class

2019-02-25 Thread ASF GitHub Bot (JIRA)


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

ASF GitHub Bot logged work on HIVE-21198:
-

Author: ASF GitHub Bot
Created on: 25/Feb/19 14:06
Start Date: 25/Feb/19 14:06
Worklog Time Spent: 10m 
  Work Description: dlavati commented on pull request #550: HIVE-21198 
Introduce a database object reference class
URL: https://github.com/apache/hive/pull/550
 
 
   
 

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
---

Worklog Id: (was: 203676)
Time Spent: 10m
Remaining Estimate: 0h

> Introduce a database object reference class
> ---
>
> Key: HIVE-21198
> URL: https://issues.apache.org/jira/browse/HIVE-21198
> Project: Hive
>  Issue Type: Improvement
>Reporter: Zoltan Haindrich
>Assignee: David Lavati
>Priority: Major
>  Labels: pull-request-available
> Attachments: HIVE-21198.1.patch, HIVE-21198.2.patch, 
> HIVE-21198.3.patch, HIVE-21198.4.patch
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> There are many places in which "{databasename}.{tablename}" is passed as a 
> single string; there are some places where the they travel as 2 separate 
> arguments.
> Idea would be to introduce a simple immutable class with 2 fields ; and pass 
> these informations together. Making this better is required if we would be 
> wanting to enable dot in tablenames 
> HIVE-16907, HIVE-21151



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)