code: def compare_result_values(
      pdf1, pdf2, acceptable_difference, use_percentage, engine
  ):
      """
      The purpose of this functions is to compare the values from blazingsql and drill/spark results.
  
      ----------
      pdf1 : blazing results (pandas dataframe)
      pdf2: drill/spark results (pandas dataframe)
      acceptable_difference: This parameter is related to the acceptable difference beetween values
      from blazingsql results and drill/spark results.
      use_percentage: (True/False) to indicate if the results will be compared by percentage or difference.
      engine: pydrill or pyspark instances
      """
  
      np.warnings.filterwarnings("ignore")
  
      if pdf1.size == 0 and pdf2.size == 0:
          return "Success"
  
      msg = ""
      if not isinstance(engine, str):
          if isinstance(engine, PyDrill):
              msg = "PyDrill"
          else:
              msg = "PySpark"
      elif engine == "drill":
          msg = "PyDrill"
      else:
          msg = "PySpark"
  
      msg = ""
      if not isinstance(engine, str):
          if isinstance(engine, PyDrill):
              msg = "PyDrill"
          else:
              msg = "PySpark"
      elif engine == "drill":
          msg = "PyDrill"
      else:
          msg = "PySpark"
  
      if pdf1.shape[0] == pdf2.shape[0]:
          if pdf1.shape[1] == pdf2.shape[1]:
              for name in pdf1.columns:
                  if pdf1[name].dtype == np.object:
                      pdf1[name] = pdf1[name].astype("string")
  
              for name in pdf2.columns:
                  if pdf2[name].dtype == np.object:
                      pdf2[name] = pdf2[name].astype("string")
  
              # Removing indexes, because those are considered when
              # comparing with equals()
              pdf1.reset_index(drop=True, inplace=True)
              pdf2.reset_index(drop=True, inplace=True)
  
              # Make the column labels equal as equals() also compare labels
              orig_pdf2_labels = pdf2.columns.to_list()
              pdf2.columns = pdf1.columns.to_list()
  
              exac_comp = pdf1.select_dtypes(exclude=np.inexact).equals(
                  pdf2.select_dtypes(exclude=np.inexact)
              )
  
              # Restore labels
              pdf2.columns = orig_pdf2_labels
  
              tmp_pdf1 = pdf1.select_dtypes(include=np.inexact)
              tmp_pdf2 = pdf2.select_dtypes(include=np.inexact)
  
              if use_percentage:
                  relative_tolerance = acceptable_difference
                  absolute_tolerance = 0
              else:
                  relative_tolerance = 0
                  absolute_tolerance = acceptable_difference
              # np.allclose follows this formula:
              #    absolute(a - b) <= (absolute_tolerance + relative_tolerance * absolute(b))
  
              res = np.all(exac_comp) and np.allclose(
                  tmp_pdf1.values,
                  tmp_pdf2.values,
                  relative_tolerance,
                  absolute_tolerance,
                  equal_nan=True,
              )
              if res:
                  return "Success"
              else:
                  return "Fail: Different values"
          else:
              return (
                  "Fail: Different number of columns blzSQLresult: "
                  + str(pdf1.shape[1])
                  + " "
                  + msg
                  + " result: "
                  + str(pdf2.shape[1])
              )
      else:
          return (
              "Fail: Different number of rows blzSQLresult: "
              + str(pdf1.shape[0])
              + " "
              + msg
              + " result: "
              + str(pdf2.shape[0])
          )
  
imports: import json
  import logging
  import os
  import re
  import time
  import yaml
  import numpy
  import pandas
  import blazingsql
  from blazingsql import DataType
  from BlazingLogging import loggingHandler
  from Configuration import ExecutionMode
  from Configuration import Settings
  from DataBase import createSchema
label_desc: Use image node_id 6 for calling a global function with example usage: compare_result_values(pdf1, pdf2, acceptable_difference, use_percentage, engine) and returns: str, unknown, unknown, str, str