Hive
  1. Hive
  2. HIVE-855

UDF: Concat should accept multiple arguments

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.5.0
    • Fix Version/s: 0.5.0
    • Component/s: Query Processor
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      HIVE-855. UDF: Concat should accept multiple arguments. (Paul Yang via zshao)
    • Tags:
      udf

      Description

      According to mysql, concat should accept multiple arguments.

      http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat

      1. HIVE-855.1.patch
        3 kB
        Paul Yang
      2. HIVE-855.2.patch
        4 kB
        Paul Yang
      3. HIVE-855.3.patch
        12 kB
        Paul Yang
      4. HIVE-855.4.patch
        13 kB
        Paul Yang
      5. HIVE-855.5.patch
        14 kB
        Paul Yang

        Issue Links

          Activity

          Zheng Shao created issue -
          Zheng Shao made changes -
          Field Original Value New Value
          Link This issue is duplicated by HIVE-856 [ HIVE-856 ]
          Hide
          Paul Yang added a comment -

          Modified UDFConcat to handle multiple arguments. Also includes test file.

          Show
          Paul Yang added a comment - Modified UDFConcat to handle multiple arguments. Also includes test file.
          Paul Yang made changes -
          Attachment HIVE-855.1.patch [ 12420855 ]
          Zheng Shao made changes -
          Assignee Paul Yang [ pauly ]
          Hide
          Zheng Shao added a comment -

          @HIVE-855.1.patch:

          -    value = "_FUNC_(str1, str2) - returns the concatenation of str1 and str2",
          +    value = "_FUNC_(str1, str2, ... strN) - returns the concatenation of str1 and str2",
          

          Minor issue, the comment should say "returns the concatenation of str1, str2, ... strN".

          By the way, I forget to tell you that we need to do two more things:
          1. Add "describe" and "describe extended" to the udf_concat.q file. Take a look at "trunk/ql/src/test/queries/clientpositive/udf_hour_minute_second.q" for example.
          2. Overwrite the test that contains "show functions" - it might be changed whenever we are editing UDFs.

          Please upload the new patch as HIVE-855.2.patch.

          Show
          Zheng Shao added a comment - @ HIVE-855 .1.patch: - value = "_FUNC_(str1, str2) - returns the concatenation of str1 and str2" , + value = "_FUNC_(str1, str2, ... strN) - returns the concatenation of str1 and str2" , Minor issue, the comment should say "returns the concatenation of str1, str2, ... strN". By the way, I forget to tell you that we need to do two more things: 1. Add "describe" and "describe extended" to the udf_concat.q file. Take a look at "trunk/ql/src/test/queries/clientpositive/udf_hour_minute_second.q" for example. 2. Overwrite the test that contains "show functions" - it might be changed whenever we are editing UDFs. Please upload the new patch as HIVE-855 .2.patch.
          Hide
          Paul Yang added a comment -

          Fixed comment about multiple arguments
          Added "describe" and "describe extended" to the udf_concat.q
          Ran show_functions.q but since concat existed previously, show_function.q.out did not change

          Show
          Paul Yang added a comment - Fixed comment about multiple arguments Added "describe" and "describe extended" to the udf_concat.q Ran show_functions.q but since concat existed previously, show_function.q.out did not change
          Paul Yang made changes -
          Attachment HIVE-855.2.patch [ 12420866 ]
          Hide
          Zheng Shao added a comment -

          +1. Will test and commit.

          Show
          Zheng Shao added a comment - +1. Will test and commit.
          Hide
          Paul Yang added a comment -

          Modified & moved unknown_functions5.q to udf_concat_insert1.q in clientpositive
          Modified & moved invalid_function_param1.q to udf_concat_insert2.q in clientpositive
          Added / deleted respective output files

          Show
          Paul Yang added a comment - Modified & moved unknown_functions5.q to udf_concat_insert1.q in clientpositive Modified & moved invalid_function_param1.q to udf_concat_insert2.q in clientpositive Added / deleted respective output files
          Paul Yang made changes -
          Attachment HIVE-855.3.patch [ 12421077 ]
          Hide
          Zheng Shao added a comment -

          @HIVE-855.3.patch: ql/src/test/results/clientpositive/udf_concat_insert2.q.out
          Can you modify the key type from INT to STRING? Otherwise it's hard to know if the concat run successfully or not.

          Show
          Zheng Shao added a comment - @ HIVE-855 .3.patch: ql/src/test/results/clientpositive/udf_concat_insert2.q.out Can you modify the key type from INT to STRING? Otherwise it's hard to know if the concat run successfully or not.
          Hide
          Paul Yang added a comment -

          Changed key from INT to STRING in udf_concat_insert2.q

          Show
          Paul Yang added a comment - Changed key from INT to STRING in udf_concat_insert2.q
          Paul Yang made changes -
          Attachment HIVE-855.4.patch [ 12421083 ]
          Hide
          Paul Yang added a comment -

          Updated definition of concat in describe_function.q.out

          Show
          Paul Yang added a comment - Updated definition of concat in describe_function.q.out
          Paul Yang made changes -
          Attachment HIVE-855.5.patch [ 12421153 ]
          Hide
          Zheng Shao added a comment -

          Committed. Thanks Paul!

          Show
          Zheng Shao added a comment - Committed. Thanks Paul!
          Zheng Shao made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Hadoop Flags [Reviewed]
          Release Note HIVE-855. UDF: Concat should accept multiple arguments. (Paul Yang via zshao)
          Fix Version/s 0.5.0 [ 12314156 ]
          Resolution Fixed [ 1 ]
          Tags udf
          Carl Steinbach made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          10d 10h 21m 1 Zheng Shao 05/Oct/09 10:33
          Resolved Resolved Closed Closed
          802d 14h 32m 1 Carl Steinbach 17/Dec/11 00:06

            People

            • Assignee:
              Paul Yang
              Reporter:
              Zheng Shao
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development