Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.10.0
    • Component/s: SQL
    • Labels:
      None

      Description

      Since table properties can be defined arbitrarily, they should be easy for a user to query from the command-line.

      SHOW TBLPROPERTIES tblname;
      ...would show all of them, one per row, key \t value

      SHOW TBLPROPERTIES tblname ("FOOBAR");
      ...would just show the value for the FOOBAR tblproperty.

        Activity

        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-hadoop2 #54 (See https://builds.apache.org/job/Hive-trunk-hadoop2/54/)
        HIVE-2530. Implement SHOW TBLPROPERTIES. (leizhao via kevinwilfong) (Revision 1327189)

        Result = ABORTED
        kevinwilfong : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1327189
        Files :

        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java
        • /hive/trunk/ql/src/test/queries/clientpositive/show_tblproperties.q
        • /hive/trunk/ql/src/test/results/clientpositive/show_tblproperties.q.out
        Show
        Hudson added a comment - Integrated in Hive-trunk-hadoop2 #54 (See https://builds.apache.org/job/Hive-trunk-hadoop2/54/ ) HIVE-2530 . Implement SHOW TBLPROPERTIES. (leizhao via kevinwilfong) (Revision 1327189) Result = ABORTED kevinwilfong : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1327189 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java /hive/trunk/ql/src/test/queries/clientpositive/show_tblproperties.q /hive/trunk/ql/src/test/results/clientpositive/show_tblproperties.q.out
        Hide
        Ashutosh Chauhan added a comment -

        Correct. Updated the Fix version for it.

        Show
        Ashutosh Chauhan added a comment - Correct. Updated the Fix version for it.
        Hide
        Lars Francke added a comment -

        This was not released with Hive 0.9.0. It wasn't merged into branch-0.9 so it'll only come in 0.10 (or 0.9.1 or whatever). I can't change the Fix version field. Could someone else do that?

        Show
        Lars Francke added a comment - This was not released with Hive 0.9.0. It wasn't merged into branch-0.9 so it'll only come in 0.10 (or 0.9.1 or whatever). I can't change the Fix version field. Could someone else do that?
        Hide
        Ashutosh Chauhan added a comment -

        This issue is closed now. It was released with the fix in 0.9.0. If there is a problem, please open a new jira and link this one with that.

        Show
        Ashutosh Chauhan added a comment - This issue is closed now. It was released with the fix in 0.9.0. If there is a problem, please open a new jira and link this one with that.
        Hide
        Hudson added a comment -

        Integrated in Hive-trunk-h0.21 #1379 (See https://builds.apache.org/job/Hive-trunk-h0.21/1379/)
        HIVE-2530. Implement SHOW TBLPROPERTIES. (leizhao via kevinwilfong) (Revision 1327189)

        Result = SUCCESS
        kevinwilfong : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1327189
        Files :

        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java
        • /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java
        • /hive/trunk/ql/src/test/queries/clientpositive/show_tblproperties.q
        • /hive/trunk/ql/src/test/results/clientpositive/show_tblproperties.q.out
        Show
        Hudson added a comment - Integrated in Hive-trunk-h0.21 #1379 (See https://builds.apache.org/job/Hive-trunk-h0.21/1379/ ) HIVE-2530 . Implement SHOW TBLPROPERTIES. (leizhao via kevinwilfong) (Revision 1327189) Result = SUCCESS kevinwilfong : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1327189 Files : /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java /hive/trunk/ql/src/test/queries/clientpositive/show_tblproperties.q /hive/trunk/ql/src/test/results/clientpositive/show_tblproperties.q.out
        Hide
        Kevin Wilfong added a comment -

        Committed, thanks Lei.

        Show
        Kevin Wilfong added a comment - Committed, thanks Lei.
        Hide
        Kevin Wilfong added a comment -

        Ashutosh: I agree that the information can already be viewed via a describe formatted command, however, for tables with a large number of properties, or even a large number of columns or large column comments, it becomes difficult for users to quickly find the property they're looking for. This will help provide a clean view and ease readability.

        Show
        Kevin Wilfong added a comment - Ashutosh: I agree that the information can already be viewed via a describe formatted command, however, for tables with a large number of properties, or even a large number of columns or large column comments, it becomes difficult for users to quickly find the property they're looking for. This will help provide a clean view and ease readability.
        Hide
        Phabricator added a comment -

        kevinwilfong has accepted the revision "HIVE-2530 [jira] Implement SHOW TBLPROPERTIES".

        +1 will commit if tests pass.

        REVISION DETAIL
        https://reviews.facebook.net/D2589

        BRANCH
        svn

        Show
        Phabricator added a comment - kevinwilfong has accepted the revision " HIVE-2530 [jira] Implement SHOW TBLPROPERTIES". +1 will commit if tests pass. REVISION DETAIL https://reviews.facebook.net/D2589 BRANCH svn
        Hide
        Phabricator added a comment -

        leizhao updated the revision "HIVE-2530 [jira] Implement SHOW TBLPROPERTIES".
        Reviewers: JIRA

        Thanks for catching those copy/paste issues!

        REVISION DETAIL
        https://reviews.facebook.net/D2589

        AFFECTED FILES
        ql/src/test/results/clientpositive/show_tblproperties.q.out
        ql/src/test/queries/clientpositive/show_tblproperties.q
        ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java
        ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java
        ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
        ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
        ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java

        Show
        Phabricator added a comment - leizhao updated the revision " HIVE-2530 [jira] Implement SHOW TBLPROPERTIES". Reviewers: JIRA Thanks for catching those copy/paste issues! REVISION DETAIL https://reviews.facebook.net/D2589 AFFECTED FILES ql/src/test/results/clientpositive/show_tblproperties.q.out ql/src/test/queries/clientpositive/show_tblproperties.q ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
        Hide
        Phabricator added a comment -

        kevinwilfong has commented on the revision "HIVE-2530 [jira] Implement SHOW TBLPROPERTIES".

        Thanks, Lei. I just noticed a couple more small things.

        INLINE COMMENTS
        ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java:2532-2534 Thanks for making it one try catch block. One other thing I noticed is we're doing this twice, but it looks like doing it at the beginning of the try should be sufficient.
        ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java:38 Could you update this comment, it's not show tables.
        ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java:42 here too.
        ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java:62-65 The descriptions of these variables looks wrong.

        REVISION DETAIL
        https://reviews.facebook.net/D2589

        Show
        Phabricator added a comment - kevinwilfong has commented on the revision " HIVE-2530 [jira] Implement SHOW TBLPROPERTIES". Thanks, Lei. I just noticed a couple more small things. INLINE COMMENTS ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java:2532-2534 Thanks for making it one try catch block. One other thing I noticed is we're doing this twice, but it looks like doing it at the beginning of the try should be sufficient. ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java:38 Could you update this comment, it's not show tables. ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java:42 here too. ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java:62-65 The descriptions of these variables looks wrong. REVISION DETAIL https://reviews.facebook.net/D2589
        Hide
        Phabricator added a comment -

        leizhao updated the revision "HIVE-2530 [jira] Implement SHOW TBLPROPERTIES".
        Reviewers: JIRA

        Thanks for the feedback! Updated accordingly.

        REVISION DETAIL
        https://reviews.facebook.net/D2589

        AFFECTED FILES
        ql/src/test/results/clientpositive/show_tblproperties.q.out
        ql/src/test/queries/clientpositive/show_tblproperties.q
        ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java
        ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java
        ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
        ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
        ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java

        Show
        Phabricator added a comment - leizhao updated the revision " HIVE-2530 [jira] Implement SHOW TBLPROPERTIES". Reviewers: JIRA Thanks for the feedback! Updated accordingly. REVISION DETAIL https://reviews.facebook.net/D2589 AFFECTED FILES ql/src/test/results/clientpositive/show_tblproperties.q.out ql/src/test/queries/clientpositive/show_tblproperties.q ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
        Hide
        Phabricator added a comment -

        kevinwilfong has commented on the revision "HIVE-2530 [jira] Implement SHOW TBLPROPERTIES".

        Looks good, just a few comments.

        INLINE COMMENTS
        ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java:370 The Table class already has a getParameters method which does exactly this. While I agree that the inconsistencies between the uses of the words Parameters and Properties throughout the code is confusing, could you either call that method instead or at least have this method return the result of getParameters(), which would at least help to keep them consistent going forward.
        ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java:55 spelling
        ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java:2573 Given that when this feature was requested, very specific guidelines were provided for how to format the data (one per row, tabs between property and value) it looks like this is wanted to make it easier to parse the properties from a query. Adding this line will make that a little more difficult.

        In addition, there is a precedent for not adding a line like this in commands like SHOW PARTITIONS and DESCRIBE which list the partitions and columns respectively without a descriptive line like this.
        ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java:2526-2527 I'm guessing you got this from the implementation of DESCRIBE TABLE?

        The reasoning for having that line there was so that you could describe "the types within the column in the case when the column is an object"
        https://issues.apache.org/jira/browse/HIVE-62

        That shouldn't apply to this method, so you should be able to assume that the table name is the table name, without this parsing.
        ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java:2533-2542 Could you put this code in the try catch block below. The stringifyException method prints a stack trace so developers will be able to figure out if the table was null or not. The catch code looks identical, so this will help remove some duplicate code.

        REVISION DETAIL
        https://reviews.facebook.net/D2589

        Show
        Phabricator added a comment - kevinwilfong has commented on the revision " HIVE-2530 [jira] Implement SHOW TBLPROPERTIES". Looks good, just a few comments. INLINE COMMENTS ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java:370 The Table class already has a getParameters method which does exactly this. While I agree that the inconsistencies between the uses of the words Parameters and Properties throughout the code is confusing, could you either call that method instead or at least have this method return the result of getParameters(), which would at least help to keep them consistent going forward. ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java:55 spelling ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java:2573 Given that when this feature was requested, very specific guidelines were provided for how to format the data (one per row, tabs between property and value) it looks like this is wanted to make it easier to parse the properties from a query. Adding this line will make that a little more difficult. In addition, there is a precedent for not adding a line like this in commands like SHOW PARTITIONS and DESCRIBE which list the partitions and columns respectively without a descriptive line like this. ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java:2526-2527 I'm guessing you got this from the implementation of DESCRIBE TABLE? The reasoning for having that line there was so that you could describe "the types within the column in the case when the column is an object" https://issues.apache.org/jira/browse/HIVE-62 That shouldn't apply to this method, so you should be able to assume that the table name is the table name, without this parsing. ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java:2533-2542 Could you put this code in the try catch block below. The stringifyException method prints a stack trace so developers will be able to figure out if the table was null or not. The catch code looks identical, so this will help remove some duplicate code. REVISION DETAIL https://reviews.facebook.net/D2589
        Hide
        Phabricator added a comment -

        leizhao requested code review of "HIVE-2530 [jira] Implement SHOW TBLPROPERTIES".
        Reviewers: JIRA

        https://issues.apache.org/jira/browse/HIVE-2530

        Implemented new feature SHOW TBLPROPERTIES

        Since table properties can be defined arbitrarily, they should be easy for a user to query from the command-line.

        SHOW TBLPROPERTIES tblname;
        ...would show all of them, one per row, key \t value

        SHOW TBLPROPERTIES tblname ("FOOBAR");
        ...would just show the value for the FOOBAR tblproperty.

        TEST PLAN
        EMPTY

        REVISION DETAIL
        https://reviews.facebook.net/D2589

        AFFECTED FILES
        ql/src/test/results/clientpositive/show_tblproperties.q.out
        ql/src/test/queries/clientpositive/show_tblproperties.q
        ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java
        ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java
        ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
        ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java
        ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java
        ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java
        ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java

        MANAGE HERALD DIFFERENTIAL RULES
        https://reviews.facebook.net/herald/view/differential/

        WHY DID I GET THIS EMAIL?
        https://reviews.facebook.net/herald/transcript/5907/

        Tip: use the X-Herald-Rules header to filter Herald messages in your client.

        Show
        Phabricator added a comment - leizhao requested code review of " HIVE-2530 [jira] Implement SHOW TBLPROPERTIES". Reviewers: JIRA https://issues.apache.org/jira/browse/HIVE-2530 Implemented new feature SHOW TBLPROPERTIES Since table properties can be defined arbitrarily, they should be easy for a user to query from the command-line. SHOW TBLPROPERTIES tblname; ...would show all of them, one per row, key \t value SHOW TBLPROPERTIES tblname ("FOOBAR"); ...would just show the value for the FOOBAR tblproperty. TEST PLAN EMPTY REVISION DETAIL https://reviews.facebook.net/D2589 AFFECTED FILES ql/src/test/results/clientpositive/show_tblproperties.q.out ql/src/test/queries/clientpositive/show_tblproperties.q ql/src/java/org/apache/hadoop/hive/ql/plan/ShowTblPropertiesDesc.java ql/src/java/org/apache/hadoop/hive/ql/plan/DDLWork.java ql/src/java/org/apache/hadoop/hive/ql/plan/HiveOperation.java ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzerFactory.java ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Table.java ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java MANAGE HERALD DIFFERENTIAL RULES https://reviews.facebook.net/herald/view/differential/ WHY DID I GET THIS EMAIL? https://reviews.facebook.net/herald/transcript/5907/ Tip: use the X-Herald-Rules header to filter Herald messages in your client.
        Hide
        Ashutosh Chauhan added a comment -

        This could already be done via desc formatted tblname

        Show
        Ashutosh Chauhan added a comment - This could already be done via desc formatted tblname

          People

          • Assignee:
            Lei Zhao
            Reporter:
            Adam Kramer
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development