Hive
  1. Hive
  2. HIVE-6622

UDF translate doesn't take either CHAR or VARCHAR as any of its arguments

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.12.0
    • Fix Version/s: 0.14.0
    • Component/s: UDF
    • Labels:
      None

      Description

      UDF translate(input, from, to) doesn't accept any CHAR or VARCHAR typed argument.

      hive> desc vc;
      c                   	char(5)             	None                
      vc                  	varchar(7)          	None                
      s                   	string              	None                
      hive> select translate("my input", c, "ll") from vc;
      FAILED: SemanticException [Error 10016]: Line 1:29 Argument type mismatch 'c': A string argument was expected but an argument of type char(5) was given.
      

      However, if the type is String, then the UDF works fine.

        Activity

        Hide
        Thejas M Nair added a comment -

        This has been fixed in 0.14 release. Please open new jira if you see any issues.

        Show
        Thejas M Nair added a comment - This has been fixed in 0.14 release. Please open new jira if you see any issues.
        Hide
        Szehon Ho added a comment -

        Added doc as described.

        Show
        Szehon Ho added a comment - Added doc as described.
        Hide
        Lefty Leverenz added a comment -

        User doc for translate(input, from, to) is here:

        so a note should be added to the description, saying CHAR and VARCHAR are supported as of Hive 0.14.0 and linking to this jira. Also, the name/signature column should show CHAR and VARCHAR alternatives.

        Show
        Lefty Leverenz added a comment - User doc for translate(input, from, to) is here: Hive Operators and UDFs – String Functions so a note should be added to the description, saying CHAR and VARCHAR are supported as of Hive 0.14.0 and linking to this jira. Also, the name/signature column should show CHAR and VARCHAR alternatives.
        Hide
        Xuefu Zhang added a comment -

        Patch committed to trunk. Thanks Wilbur for the contribution.

        Show
        Xuefu Zhang added a comment - Patch committed to trunk. Thanks Wilbur for the contribution.
        Hide
        Hive QA added a comment -

        Overall: -1 at least one tests failed

        Here are the results of testing the latest attachment:
        https://issues.apache.org/jira/secure/attachment/12651332/HIVE-6622.1.patch

        ERROR: -1 due to 5 failed/errored test(s), 5653 tests executed
        Failed tests:

        org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_root_dir_external_table
        org.apache.hadoop.hive.cli.TestNegativeCliDriver.testNegativeCliDriver_authorization_ctas
        org.apache.hive.hcatalog.pig.TestHCatLoader.testReadDataPrimitiveTypes
        org.apache.hive.hcatalog.pig.TestOrcHCatLoader.testReadDataPrimitiveTypes
        org.apache.hive.jdbc.miniHS2.TestHiveServer2.testConnection
        

        Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-Build/526/testReport
        Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-Build/526/console
        Test logs: http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-Build-526/

        Messages:

        Executing org.apache.hive.ptest.execution.PrepPhase
        Executing org.apache.hive.ptest.execution.ExecutionPhase
        Executing org.apache.hive.ptest.execution.ReportingPhase
        Tests exited with: TestsFailedException: 5 tests failed
        

        This message is automatically generated.

        ATTACHMENT ID: 12651332

        Show
        Hive QA added a comment - Overall : -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12651332/HIVE-6622.1.patch ERROR: -1 due to 5 failed/errored test(s), 5653 tests executed Failed tests: org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_root_dir_external_table org.apache.hadoop.hive.cli.TestNegativeCliDriver.testNegativeCliDriver_authorization_ctas org.apache.hive.hcatalog.pig.TestHCatLoader.testReadDataPrimitiveTypes org.apache.hive.hcatalog.pig.TestOrcHCatLoader.testReadDataPrimitiveTypes org.apache.hive.jdbc.miniHS2.TestHiveServer2.testConnection Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-Build/526/testReport Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-Build/526/console Test logs: http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-Build-526/ Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 5 tests failed This message is automatically generated. ATTACHMENT ID: 12651332
        Hide
        Xuefu Zhang added a comment -

        Wilbur Yang Thanks for submitting the patch. However, you need to send an email to dev@hive.apache.org requesting to be included as a contributor. After that, the JIRA can be assigned to you.

        +1 pending on the test run.

        Show
        Xuefu Zhang added a comment - Wilbur Yang Thanks for submitting the patch. However, you need to send an email to dev@hive.apache.org requesting to be included as a contributor. After that, the JIRA can be assigned to you. +1 pending on the test run.

          People

          • Assignee:
            Wilbur Yang
            Reporter:
            Xuefu Zhang
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development