docstr: Build a `SELECT * REPLACE(...) FROM table_name` query for a table
  that converts unsupported column types to varchar columns
docstr_tok: ["Build","a","`","SELECT","*","REPLACE","(","...",")","FROM","table_name","`","query","for","a","table","that","converts","unsupported","column","types","to","varchar","columns"]
code: def _replace_query_for_table(self, table_name: str):
      """
      Build a `SELECT * REPLACE(...) FROM table_name` query for a table
      that converts unsupported column types to varchar columns
      """
      rel = self.conn.view(table_name)
      replaces = []
      for col, type_name in zip(rel.columns, rel.dtypes):
          quoted_col_name = quote_column(col)
          try:
              duckdb_type_name_to_pyarrow_type(type_name)
              # Skip columns with supported types
          except ValueError:
              # Convert unsupported types to strings (except struct)
              if not str(type_name).startswith("STRUCT"):
                  replaces.append(
                      f"{quoted_col_name}::varchar as {quoted_col_name}"
                  )
  
      if replaces:
          replace_csv = ", ".join(replaces)
          return f"SELECT * REPLACE({replace_csv}) FROM {table_name}"
      else:
          return f"SELECT * FROM {table_name}"
  
imports: import re
  import warnings
  from .None import SqlConnection, CsvReadOptions
  from typing import Dict, Optional
  from distutils.version import LooseVersion
  import duckdb
  import pyarrow
  import pyarrow.feather
  import pandas
  import logging
  import uuid
label_desc: Use image node_id 4 for calling the DuckDbConnection obj's underlying member method code with example usage: obj._replace_query_for_table(table_name) and returns: str, replace_csv, str, table_name, str, table_name