Hive
  1. Hive
  2. HIVE-580

command to list available UDF names

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.4.0
    • Component/s: Clients, Documentation
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      It would be great if there was some way to list all available UDF names in the CLI.

      Ideally, there would be some way for the UDFs themselves to provide a description/help that could also be displayed.

      Would also be nice if the UDF names were available for auto-completion (HIVE-97).

      As a start, just having the names available would be great.

      1. hive-580-2009-07-26-2.patch
        16 kB
        Scott Chen
      2. hive-580-2009-07-26-1.patch
        16 kB
        Scott Chen
      3. hive-580-2009-07-26.patch
        14 kB
        Scott Chen
      4. hive-580-2009-07-25.patch
        13 kB
        Scott Chen
      5. hive-580-2009-07-15.patch
        4 kB
        He Yongqiang

        Issue Links

          Activity

          Hide
          Zheng Shao added a comment -

          That's a good idea.
          It should be pretty easy to do since FunctionRegistry has all the information needed.

          Show
          Zheng Shao added a comment - That's a good idea. It should be pretty easy to do since FunctionRegistry has all the information needed.
          Hide
          Ashish Thusoo added a comment -

          +1.

          Additionally I think we should support UDFs persistently as well (not just create temporary function but also create function)

          Show
          Ashish Thusoo added a comment - +1. Additionally I think we should support UDFs persistently as well (not just create temporary function but also create function)
          Hide
          Prasad Chakka added a comment -

          @yongqing, we are trying to move away from processing queries inside CliDriver.java. This just creates problems later on. Joydeep is planning to move all such commands/constructs (set, add, comments) from CliDriver into parser. I don't think we should add this command here.

          Show
          Prasad Chakka added a comment - @yongqing, we are trying to move away from processing queries inside CliDriver.java. This just creates problems later on. Joydeep is planning to move all such commands/constructs (set, add, comments) from CliDriver into parser. I don't think we should add this command here.
          Hide
          He Yongqiang added a comment -

          That's good. We should avoid adding all command processing logics in one CliDriver. I can see CliDriver will get fatter and fatter as new commands got in.

          Show
          He Yongqiang added a comment - That's good. We should avoid adding all command processing logics in one CliDriver. I can see CliDriver will get fatter and fatter as new commands got in.
          Hide
          Namit Jain added a comment -

          Yes, it would be better to add a 'show functions' command supported by the hive parser itself.

          Show
          Namit Jain added a comment - Yes, it would be better to add a 'show functions' command supported by the hive parser itself.
          Hide
          Scott Chen added a comment -

          "SHOW FUNCTIONS;" will list all the udf.
          "SHOW FUNCTIONS 'regular expression string';" will list all the udf matches the regular expression.
          Most of the logic in this patch follows "SHOW TABLE".

          Show
          Scott Chen added a comment - "SHOW FUNCTIONS;" will list all the udf. "SHOW FUNCTIONS 'regular expression string';" will list all the udf matches the regular expression. Most of the logic in this patch follows "SHOW TABLE".
          Hide
          He Yongqiang added a comment -

          The patch looks good. Can you use hadoop conversion for code format? (showFunctionsDesc and DDLSemanticAnalyzer)

          Show
          He Yongqiang added a comment - The patch looks good. Can you use hadoop conversion for code format? (showFunctionsDesc and DDLSemanticAnalyzer)
          Hide
          Namit Jain added a comment -

          Also, can you add some property which shows the signature and the properties of the function (whether it is temporary or not).
          You can add something like:

          describe function

          {extended}

          You can also do the describe in a follow-up - in that case please file a JIRA for the same

          Show
          Namit Jain added a comment - Also, can you add some property which shows the signature and the properties of the function (whether it is temporary or not). You can add something like: describe function {extended} You can also do the describe in a follow-up - in that case please file a JIRA for the same
          Hide
          Zheng Shao added a comment -

          Overall the patch looks pretty good. Some nitpicks:
          @hive-580-2009-07-25.patch:
          43,47: Can you add javadoc for all new functions? I know we don't have javadoc for all functions, but a while back we've decided to add "javadoc" for all new functions (and gradually do that for all old functions as well).
          141: LOG.warn instead of LOG.info. (Can you do the same change to showTables?)

          Show
          Zheng Shao added a comment - Overall the patch looks pretty good. Some nitpicks: @hive-580-2009-07-25.patch: 43,47: Can you add javadoc for all new functions? I know we don't have javadoc for all functions, but a while back we've decided to add "javadoc" for all new functions (and gradually do that for all old functions as well). 141: LOG.warn instead of LOG.info. (Can you do the same change to showTables?)
          Hide
          Zheng Shao added a comment -

          Since we already have HIVE-691, let's use that one for "describe function

          {extended}

          ".

          Show
          Zheng Shao added a comment - Since we already have HIVE-691 , let's use that one for "describe function {extended} ".
          Hide
          Scott Chen added a comment -

          @Yongqing: Thanks. I have checked with the convention but I only changed few things. It would be good if you can point out the file and lineno.

          @Namit: That is a very good suggestion. But as Zheng mentioned there's hive-691 on this one.

          @Zheng: Thanks for the comments. I have add javadoc to 3 new functions that I added. And LOG.info has been changed to LOG.warn in both showFunctions and showTables.

          Show
          Scott Chen added a comment - @Yongqing: Thanks. I have checked with the convention but I only changed few things. It would be good if you can point out the file and lineno. @Namit: That is a very good suggestion. But as Zheng mentioned there's hive-691 on this one. @Zheng: Thanks for the comments. I have add javadoc to 3 new functions that I added. And LOG.info has been changed to LOG.warn in both showFunctions and showTables.
          Hide
          Ashish Thusoo added a comment -

          One question about this patch. This does not print out UDAFs - granted that we do not yet have the capability to register UDAFs but I think it would be good to be able to list out UDAFs as well considering that we are adding new ones soon. Also show_functions.q.out does not seem to be part of the patch.

          Show
          Ashish Thusoo added a comment - One question about this patch. This does not print out UDAFs - granted that we do not yet have the capability to register UDAFs but I think it would be good to be able to list out UDAFs as well considering that we are adding new ones soon. Also show_functions.q.out does not seem to be part of the patch.
          Hide
          Scott Chen added a comment -

          @Ashish: Sorry I forgot to svn add show_function.q.out. The UDAF in FunctionRegistry will also be listed out.

          Show
          Scott Chen added a comment - @Ashish: Sorry I forgot to svn add show_function.q.out. The UDAF in FunctionRegistry will also be listed out.
          Hide
          Namit Jain added a comment -

          Since, mFunctions in FunctionRegistry is a hashmap - it does not guarantee any order.
          So, output of show functions is non-deterministic.

          Please change mFuntions to a linkedhashmap.

          Otherwise, the changes look good.

          Show
          Namit Jain added a comment - Since, mFunctions in FunctionRegistry is a hashmap - it does not guarantee any order. So, output of show functions is non-deterministic. Please change mFuntions to a linkedhashmap. Otherwise, the changes look good.
          Hide
          Scott Chen added a comment -

          changed HashMap -> LinkedHashMap following Namit's suggestion

          Show
          Scott Chen added a comment - changed HashMap -> LinkedHashMap following Namit's suggestion
          Hide
          Namit Jain added a comment -

          +1

          Looks good - will run tests and merge if the tests pass

          Show
          Namit Jain added a comment - +1 Looks good - will run tests and merge if the tests pass
          Hide
          Namit Jain added a comment -

          Committed. Thanks Scott

          Show
          Namit Jain added a comment - Committed. Thanks Scott
          Hide
          Scott Chen added a comment -

          Thank you very much Namit.

          Show
          Scott Chen added a comment - Thank you very much Namit.

            People

            • Assignee:
              Scott Chen
              Reporter:
              Larry Ogrodnek
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development