Example #1
0
        try:
            self.run_test_case('QueryTest/uda-mem-limit',
                               vector,
                               use_db=unique_database)
            assert False, "Query was expected to fail"
        except ImpalaBeeswaxException, e:
            self._check_mem_limit_exception(e)

        # It takes a long time for Impala to free up memory after this test, especially if
        # ASAN is enabled. Verify that all fragments finish executing before moving on to the
        # next test to make sure that the next test is not affected.
        for impalad in ImpalaCluster.get_e2e_test_cluster().impalads:
            verifier = MetricVerifier(impalad.service)
            verifier.wait_for_metric("impala-server.num-fragments-in-flight",
                                     0)
            verifier.verify_num_unused_buffers()

    def test_udf_constant_folding(self, vector, unique_database):
        """Test that constant folding of UDFs is handled correctly. Uses count_rows(),
    which returns a unique value every time it is evaluated in the same thread."""
        exec_options = copy(vector.get_value('exec_option'))
        # Execute on a single node so that all counter values will be unique.
        exec_options["num_nodes"] = 1
        create_fn_query = """create function {database}.count_rows() returns bigint
                         location '{location}' symbol='Count' prepare_fn='CountPrepare'
                         close_fn='CountClose'"""
        self._load_functions(create_fn_query, vector, unique_database,
                             get_fs_path('/test-warehouse/libTestUdfs.so'))

        # Only one distinct value if the expression is constant folded, otherwise one
        # value per row in alltypes
    except ImpalaBeeswaxException, e:
      self._check_mem_limit_exception(e)

    try:
      self.run_test_case('QueryTest/uda-mem-limit', vector, use_db=unique_database)
      assert False, "Query was expected to fail"
    except ImpalaBeeswaxException, e:
      self._check_mem_limit_exception(e)

    # It takes a long time for Impala to free up memory after this test, especially if
    # ASAN is enabled. Verify that all fragments finish executing before moving on to the
    # next test to make sure that the next test is not affected.
    for impalad in ImpalaCluster().impalads:
      verifier = MetricVerifier(impalad.service)
      verifier.wait_for_metric("impala-server.num-fragments-in-flight", 0)
      verifier.verify_num_unused_buffers()

  def test_udf_constant_folding(self, vector, unique_database):
    """Test that constant folding of UDFs is handled correctly. Uses count_rows(),
    which returns a unique value every time it is evaluated in the same thread."""
    exec_options = copy(vector.get_value('exec_option'))
    # Execute on a single node so that all counter values will be unique.
    exec_options["num_nodes"] = 1
    create_fn_query = """create function {database}.count_rows() returns bigint
                         location '{location}' symbol='Count' prepare_fn='CountPrepare'
                         close_fn='CountClose'"""
    self._load_functions(create_fn_query, vector, unique_database,
        get_fs_path('/test-warehouse/libTestUdfs.so'))

    # Only one distinct value if the expression is constant folded, otherwise one
    # value per row in alltypes
Example #3
0
 def test_num_unused_buffers(self):
     """Test that all buffers are unused"""
     verifier = MetricVerifier(self.impalad_test_service)
     verifier.verify_num_unused_buffers()
 def test_num_unused_buffers(self):
   """Test that all buffers are unused"""
   verifier = MetricVerifier(self.impalad_test_service)
   verifier.verify_num_unused_buffers()