code: def execute_filter_query(
      index_file_location: str,
      columns: list[str],
      where: str,
      limit: int,
      offset: int,
  ) -> tuple[int, pa.Table]:
      with duckdb_connect(database=index_file_location) as con:
          filter_query = FILTER_QUERY.format(
              columns=",".join(
                  [
                      f'"{column}"'
                      for column in [ROW_IDX_COLUMN] + columns
                  ]
              ),
              where=where,
              limit=limit,
              offset=offset,
          )
          filter_count_query = FILTER_COUNT_QUERY.format(where=where)
          try:
              pa_table = con.sql(filter_query).arrow()
              num_rows_total = con.sql(filter_count_query).fetchall()[
                  0
              ][0]
          except duckdb.Error:
              raise InvalidParameterError(
                  message="Parameter 'where' is invalid"
              )
      return num_rows_total, pa_table
  
imports: import logging
  import re
  from http import HTTPStatus
  from typing import Optional
  import anyio
  import duckdb
  import pyarrow
  from datasets import Features
  from libapi.authentication import auth_check
  from libapi.duckdb import get_cache_entry_from_duckdb_index_job, get_index_file_location_and_download_if_missing
  from libapi.exceptions import ApiError, InvalidParameterError, UnexpectedApiError
  from libapi.request import get_request_parameter, get_request_parameter_length, get_request_parameter_offset
  from libapi.response import ROW_IDX_COLUMN, create_response
  from libapi.utils import Endpoint, get_json_api_error_response, get_json_error_response, get_json_ok_response
  from libcommon.duckdb_utils import duckdb_index_is_partial
  from libcommon.prometheus import StepProfiler
  from libcommon.storage import StrPath
  from libcommon.storage_client import StorageClient
  from libcommon.viewer_utils.features import get_supported_unsupported_columns
  from starlette.requests import Request
  from starlette.responses import Response
  from search.duckdb_connection import duckdb_connect
label_desc: Use image node_id 2 for calling a global function with example usage: execute_filter_query(index_file_location, columns, where, limit, offset) and returns: num_rows_total,  pa_table