Re: Review Request 27847: HIVE-8295 : Add batch retrieve partition objects for metastore direct sql

2014-11-11 Thread Ashutosh Chauhan

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27847/#review60859
---



metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java


Wondering if there is any value in doing ensureDbInit() ? Seems like 
runTestQuery() is sufficient. If ensureDbInit() is indeed needed, can you 
please add comment why is it needed?


- Ashutosh Chauhan


On Nov. 11, 2014, 7:34 p.m., Sergey Shelukhin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27847/
> ---
> 
> (Updated Nov. 11, 2014, 7:34 p.m.)
> 
> 
> Review request for hive.
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> see jira
> 
> 
> Diffs
> -
> 
>   common/src/java/org/apache/hadoop/hive/conf/HiveConf.java cca57d2 
>   metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java 
> b6c633c 
>   metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 
> 758f77c 
>   
> metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java 
> 0f99cf3 
> 
> Diff: https://reviews.apache.org/r/27847/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Sergey Shelukhin
> 
>



Re: Review Request 27847: HIVE-8295 : Add batch retrieve partition objects for metastore direct sql

2014-11-11 Thread Sergey Shelukhin

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27847/
---

(Updated Nov. 11, 2014, 7:34 p.m.)


Review request for hive.


Repository: hive-git


Description
---

see jira


Diffs (updated)
-

  common/src/java/org/apache/hadoop/hive/conf/HiveConf.java cca57d2 
  metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java 
b6c633c 
  metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 758f77c 
  metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java 
0f99cf3 

Diff: https://reviews.apache.org/r/27847/diff/


Testing
---


Thanks,

Sergey Shelukhin



Re: Review Request 27847: HIVE-8295 : Add batch retrieve partition objects for metastore direct sql

2014-11-10 Thread Ashutosh Chauhan

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27847/#review60741
---


Mostly looks good. Few comments.


metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java


currently this method has fragemented and repeated logic. I think it might 
be easier to read if its written in following way:
 public MetaStoreDirectSql(PersistenceManager pm) {
 isMySql = executeDBspecificQuery(mySqlQuery);
 isOracle = executeDBspecificQuery(oracleQuery);
}

executeDBSpecificQuery(String sql) {
Transaction tx = pm.currentTransaction();
tx.begin();
boolean success = false;
try {
executeNoResult(query);
success = true;
} catch () {
LOG.debug("Oracle check failed, assuming we are not on oracle: " + 
t.getMessage());
  tx.rollback();
  tx = pm.currentTransaction();
  tx.begin();
  return false;
}

}

I think you get the idea :)



metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java


Do we need query.closeAll() ?



metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java


can be renamed to sqlResult



metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java


Do we need query.close(sqlResult2);


- Ashutosh Chauhan


On Nov. 11, 2014, 12:23 a.m., Sergey Shelukhin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27847/
> ---
> 
> (Updated Nov. 11, 2014, 12:23 a.m.)
> 
> 
> Review request for hive.
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> see jira
> 
> 
> Diffs
> -
> 
>   metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java 
> b6c633c 
>   metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 
> 2aa5d20 
>   
> metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java 
> 0f99cf3 
> 
> Diff: https://reviews.apache.org/r/27847/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Sergey Shelukhin
> 
>



Re: Review Request 27847: HIVE-8295 : Add batch retrieve partition objects for metastore direct sql

2014-11-10 Thread Sergey Shelukhin

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27847/#review60719
---



metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java


should be debug


- Sergey Shelukhin


On Nov. 11, 2014, 12:23 a.m., Sergey Shelukhin wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27847/
> ---
> 
> (Updated Nov. 11, 2014, 12:23 a.m.)
> 
> 
> Review request for hive.
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> see jira
> 
> 
> Diffs
> -
> 
>   metastore/src/java/org/apache/hadoop/hive/metastore/MetaStoreDirectSql.java 
> b6c633c 
>   metastore/src/java/org/apache/hadoop/hive/metastore/ObjectStore.java 
> 2aa5d20 
>   
> metastore/src/java/org/apache/hadoop/hive/metastore/StatObjectConverter.java 
> 0f99cf3 
> 
> Diff: https://reviews.apache.org/r/27847/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Sergey Shelukhin
> 
>