def construct_exec_result(result, exec_result):
  """ Transform an ImpalaBeeswaxResult object to a QueryResult object.

  Args:
    result (ImpalaBeeswasResult): Tranfers data from here.
    exec_result (QueryResult): Transfers data to here.

  Returns:
    QueryResult
  """

  # Return immedietely if the query failed.
  if not result.success: return exec_result
  exec_result.success = True
  attrs = ['data', 'runtime_profile', 'start_time',
      'time_taken', 'summary', 'exec_summary']
  for attr in attrs:
    setattr(exec_result, attr, getattr(result, attr))
  return exec_result