Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-1456

Hive udfs cause impalad to crash if they use String type arguments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 2.1
    • Impala 2.1
    • None

    Description

      The precondition below fails if a Hive udf uses a String as an argument type.

        /**                                                                                     
         * evaluate function called by the backend. The inputs to the UDF have                  
         * been serialized to 'input'                                                           
         */                                                                                     
        public void evaluate() throws ImpalaRuntimeException {                                  
          try {                                                                                 
            for (int i = 0; i < argTypes_.length; ++i) {                                        
              if (UnsafeUtil.UNSAFE.getByte(inputNullsPtr_ + i) == 0) {                         
                if (isArgString_[i]) {                                                          
                  Preconditions.checkState(inputArgs_[i] instanceof ImpalaBytesWritable);
      

      the value in inputArgs_ that should be a string is null.

      This came up while adding tests in tests/test-hive-udfs/src/main/java/com/cloudera/impala/TestUdf.java for IMPALA-1134. If something like

        public String evaluate(String a, String b, String c) {
          if (a == null || b == null || c == null) return null;
          return a + b + c;
        }
      

      is added, impalad crashes during execution.

      Attachments

        Activity

          People

            caseyc casey
            caseyc casey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: