[ https://issues.apache.org/jira/browse/HIVE-3589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497907#comment-13497907 ]
Phabricator commented on HIVE-3589: ----------------------------------- cwsteinbach has requested changes to the revision "HIVE-3589 [jira] describe/show partition/show tblproperties command should accept database name". INLINE COMMENTS ql/src/test/queries/clientpositive/describe_table.q:5 Please demonstrate that this also works from another db/schema, e.g: CREATE DATABASE db1; USE db1; DESCRIBE default.srcpart; ... This same request also applies to the other tests that this patch modifies. ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java:1802 Formatting. ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java:1407 It looks likes this method either returns true or throws a SemanticException. I think it should either return true or false, and either never throw an exception, or only throw an exception when the db name is not valid for syntactic reasons. ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java:1472 There's some logic in DDLSemanticAnalyzer (see QualifiedNameUtil) that looks pretty similar. It would be nice to pull QualifiedNameUtil out into its own class in hive-common and reference that code from here and DDLSemanticAnalyzer. Also, "parseExpression" is a little generic. Maybe change the name to "parseTableName"? ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java:1474 I think it would be a bit cleaner to use StringUtils.split(), e.g: String[] names = StringUtils.split(tableName, "."); switch (names.length) { ... } ql/src/java/org/apache/hadoop/hive/ql/plan/DescTableDesc.java:112 If expression[0] == null, does that always imply that we're using the default db? If so can we return "default." + expression[1] in that case? And if we do that, then we should probably just enforce that expression[0] != null in the constructor. ql/src/java/org/apache/hadoop/hive/ql/plan/DescTableDesc.java:38 Please add a note explaining that DescTableDesc is overloaded to handle both describe column and describe table, and what this parameter is expected to contain in each case. ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java:34 "expression" is too generic in this case. Please change the name to "qualifiedTableName". ql/src/java/org/apache/hadoop/hive/ql/plan/ShowPartitionsDesc.java:64 s/expression/qualifiedTableName/ REVISION DETAIL https://reviews.facebook.net/D6075 BRANCH DPAL-1916 To: JIRA, cwsteinbach, navis > describe/show partition/show tblproperties command should accept database name > ------------------------------------------------------------------------------ > > Key: HIVE-3589 > URL: https://issues.apache.org/jira/browse/HIVE-3589 > Project: Hive > Issue Type: Bug > Components: Metastore, Query Processor > Affects Versions: 0.8.1 > Reporter: Sujesh Chirackkal > Assignee: Navis > Priority: Minor > Attachments: HIVE-3589.D6075.1.patch > > > describe command not giving the details when called as describe > dbname.tablename. > Throwing the error "Table dbname not found". > Ex: hive -e "describe masterdb.table1" will throw error > "Table masterdb not found" -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira