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

FunctionContext::GetArgType() returns wrong type in UDA Merge() and Finalize()

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 2.9.0
    • Fix Version/s: Impala 2.9.0
    • Component/s: Backend
    • Labels:
      None

      Description

      This ArgType() methods should return the input types of the UDA. UDAs can get the intermediate type from GetIntermediateType() so it is redundant to pass in the intermediate type via GetArgType().

      Note that the argument types provided to Merge() are not always consistent - if Merge() is run in a spilling preaggregation, the original argument types would be provided, but if it is run in the merge aggregation, different argument types are passed in.

        Issue Links

          Activity

          Hide
          tarmstrong Tim Armstrong added a comment -

          IMPALA-1430,IMPALA-4878,IMPALA-4879: codegen native UDAs

          This uses the existing infrastructure for codegening builtin UDAs and
          for codegening calls to UDFs. GetUdf() is refactored to support both
          UDFs and UDAs.

          IR UDAs are still not allowed by the frontend. It's unclear if we want
          to enable them going forward because of the difficulties in testing and
          supporting IR UDFs/UDAs.

          This also fixes some bugs with the Get*Type() methods of
          FunctionContext. GetArgType() and related methods now always return the
          logical input types of the aggregate function. Getting the tests to pass
          required fixing IMPALA-4878 because they called GetIntermediateType().

          Testing:
          test_udfs.py tests UDAs with codegen enabled and disabled.

          Added some asserts to test UDAs to check that the correct types are
          passed in via the FunctionContext.

          Change-Id: Id1708eaa96eb76fb9bec5eeabf209f81c88eec2f
          Reviewed-on: http://gerrit.cloudera.org:8080/5161
          Reviewed-by: Dan Hecht <dhecht@cloudera.com>
          Tested-by: Impala Public Jenkins

          Show
          tarmstrong Tim Armstrong added a comment - IMPALA-1430 , IMPALA-4878 , IMPALA-4879 : codegen native UDAs This uses the existing infrastructure for codegening builtin UDAs and for codegening calls to UDFs. GetUdf() is refactored to support both UDFs and UDAs. IR UDAs are still not allowed by the frontend. It's unclear if we want to enable them going forward because of the difficulties in testing and supporting IR UDFs/UDAs. This also fixes some bugs with the Get*Type() methods of FunctionContext. GetArgType() and related methods now always return the logical input types of the aggregate function. Getting the tests to pass required fixing IMPALA-4878 because they called GetIntermediateType(). Testing: test_udfs.py tests UDAs with codegen enabled and disabled. Added some asserts to test UDAs to check that the correct types are passed in via the FunctionContext. Change-Id: Id1708eaa96eb76fb9bec5eeabf209f81c88eec2f Reviewed-on: http://gerrit.cloudera.org:8080/5161 Reviewed-by: Dan Hecht <dhecht@cloudera.com> Tested-by: Impala Public Jenkins
          Hide
          dhecht Dan Hecht added a comment -
          Show
          dhecht Dan Hecht added a comment - FYI Michael Ho

            People

            • Assignee:
              tarmstrong Tim Armstrong
              Reporter:
              tarmstrong Tim Armstrong
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development