#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.

from tests.common.test_vector import *
from tests.common.impala_test_suite import *

class TestUdfs(ImpalaTestSuite):
  @classmethod
  def get_workload(cls):
    return 'functional-query'

  @classmethod
  def add_test_dimensions(cls):
    super(TestUdfs, cls).add_test_dimensions()
    # UDFs require codegen
    cls.TestMatrix.add_constraint(
      lambda v: v.get_value('exec_option')['disable_codegen'] == False)
    # There is no reason to run these tests using all dimensions.
    cls.TestMatrix.add_constraint(lambda v:\
        v.get_value('table_format').file_format == 'text' and\
        v.get_value('table_format').compression_codec == 'none')

  def test_udfs(self, vector):
    self.run_test_case('QueryTest/udf', vector)

#!/usr/bin/env python
# Copyright (c) 2012 Cloudera, Inc. All rights reserved.

from tests.common.test_vector import *
from tests.common.impala_test_suite import *

class TestUdfs(ImpalaTestSuite):
  @classmethod
  def get_workload(cls):
    return 'functional-query'

  @classmethod
  def add_test_dimensions(cls):
    super(TestUdfs, cls).add_test_dimensions()
    # UDFs require codegen
    cls.TestMatrix.add_constraint(
      lambda v: v.get_value('exec_option')['disable_codegen'] == False)
    # There is no reason to run these tests using all dimensions.
    cls.TestMatrix.add_constraint(lambda v:\
        v.get_value('table_format').file_format == 'text' and\
        v.get_value('table_format').compression_codec == 'none')

  # This must run serially because other tests executing 'invalidate metadata' will nuke
  # all loaded functions.
  # TODO: This can be run in parallel once functions are persisted correctly.
  @pytest.mark.execute_serially
  def test_udfs(self, vector):
    self.run_test_case('QueryTest/udf', vector)

Fix UDF test, take two
Fix UDF test, take two

Change-Id: I817389d94dab665199d2c1b7365e8ce0d1495c41
Reviewed-on: http://gerrit.ent.cloudera.com:8080/504
Reviewed-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com>
Tested-by: Skye Wanderman-Milne <6d4b168ab637b0a20cc9dbf96abb2537f372f946@cloudera.com>
