Olaf Hellwich

166 papers A* 1A 4B 4C 33Misc 4Journal 49Unranked 68
YearRankTypeTitle / Venue / Authors
2026 conf
VISAPP (2)
Uros Petkovic, Jonas Frenkel, Rebecca Lazarides, Olaf Hellwich
2026 conf
VISAPP (2)
Nicolai Skutsch, Olaf Hellwich, Frank Fuchs-Kittowski
2026 J jnl
CoRR
Runfeng Qu, Ole Hall, Pia Bideau, Julie Ouerfelli-Ethier, Martin Rolfs, Klaus Obermayer, Olaf Hellwich
2025 J jnl
Environ. Model. Softw.
Lingyue Wang, Ping Hu, Hongwei Zheng, Jie Bai, Ying Liu, Xingwen Cao, Olaf Hellwich, Tie Liu, Anming Bao, Xi Chen
2025 J jnl
Multim. Tools Appl.
Reham H. Elnabawy, Slim Abdennadher, Olaf Hellwich, Seif Eldawlatly
2025 J jnl
CoRR
Gasser Elazab, Maximilian Jansen, Michael Unterreiner, Olaf Hellwich
2025 J jnl
Adapt. Behav.
Uros Petkovic, Jonas Frenkel, Olaf Hellwich, Rebecca Lazarides
2025 A conf
WACV
Gasser Elazab, Torben Gräber, Michael Unterreiner, Olaf Hellwich
2025 J jnl
CoRR
Patrik Reiske, Marcus N. Boon, Niek Andresen, Soledad Traverso, Katharina Hohlbaum, Lars Lewejohann, Christa Thöne-Reineke, Olaf Hellwich, Henning Sprekeler
2025 A conf
WACV
Monika Kwiatkowski, Simon Matern, Olaf Hellwich
2025 conf
XR (1)
Nicolai Skutsch, Olaf Hellwich, Frank Fuchs-Kittowski
2025 J jnl
CoRR
Olaf Hellwich, Niek Andresen, Katharina Hohlbaum, Marcus N. Boon, Monika Kwiatkowski, Simon Matern, Patrik Reiske, Henning Sprekeler, Christa Thöne-Reineke, Lars Lewejohann, Huma Ghani Zada, Michael Brück, Soledad Traverso
2024 J jnl
J. Univers. Comput. Sci.
Anwar Mira, Olaf Hellwich
2024 J jnl
Inteligencia Artif.
Anwar Mira, Olaf Hellwich
2024 J jnl
CoRR
Monika Kwiatkowski, Simon Matern, Olaf Hellwich
2024 J jnl
J. Supercomput.
Anwar Mira, Olaf Hellwich
2024 conf
Tiny Papers @ ICLR
Paul Kapust, Monika Kwiatkowski, Olaf Hellwich, Patrik Reiske
2024 J jnl
CoRR
Florian Blume, Runfeng Qu, Pia Bideau, Martin Maier, Rasha Abdel Rahman, Olaf Hellwich
2024 conf
GCPR (2)
Florian Blume, Runfeng Qu, Pia Bideau, Martin Maier, Rasha Abdel Rahman, Olaf Hellwich
2024 J jnl
Remote. Sens.
Yubin Song, Xuelian Xun, Hongwei Zheng, Xi Chen, Anming Bao, Ying Liu, Geping Luo, Jiaqiang Lei, Wenqiang Xu, Tie Liu, Olaf Hellwich, Qing Guan
2024 J jnl
CoRR
Gasser Elazab, Torben Gräber, Michael Unterreiner, Olaf Hellwich
2024 conf
CVPR Workshops
Marah Halawa, Florian Blume, Pia Bideau, Martin Maier, Rasha Abdel Rahman, Olaf Hellwich
2024 J jnl
CoRR
Marah Halawa, Florian Blume, Pia Bideau, Martin Maier, Rasha Abdel Rahman, Olaf Hellwich
2024 conf
SAB
Uros Petkovic, Jonas Frenkel, Olaf Hellwich, Rebecca Lazarides
2024 J jnl
CoRR
Uros Petkovic, Jonas Frenkel, Olaf Hellwich, Rebecca Lazarides
2024 conf
VISIGRAPP (3): VISAPP
Monika Kwiatkowski, Simon Matern, Olaf Hellwich
2023 conf
SSCI
Hanni Sandhu, Joana Kühne, Oliver Sawade, Martin Stellmacher, Elmar Matthes, Olaf Hellwich
2023 B conf
CBMS
Samuel Müller, Olaf Hellwich, Daniel Szymanski, Hardik Jain, Timo Krüger
2023 J jnl
CoRR
Monika Kwiatkowski, Simon Matern, Olaf Hellwich
2023 J jnl
CoRR
Boris Meinardus, Mariusz Trzeciakiewicz, Tim Herzig, Monika Kwiatkowski, Simon Matern, Olaf Hellwich
2023 J jnl
PLoS Comput. Biol.
Nicolas Roth, Martin Rolfs, Olaf Hellwich, Klaus Obermayer
2023 J jnl
CoRR
Monika Kwiatkowski, Simon Matern, Olaf Hellwich
2023 conf
VISIGRAPP (5: VISAPP)
Alexander Dolokov, Niek Andresen, Katharina Hohlbaum, Christa Thöne-Reineke, Lars Lewejohann, Olaf Hellwich
2022 J jnl
IEEE Trans. Geosci. Remote. Sens.
Haiyang Shi, Olaf Hellwich, Geping Luo, Chunbo Chen, Huili He, Friday Uchenna Ochege, Tim Van de Voorde, Alishir Kurban, Philippe De Maeyer
2022 B conf
CBMS
Reham H. Elnabawy, Slim Abdennadher, Olaf Hellwich, Seif Eldawlatly
2022 J jnl
Int. J. Appl. Earth Obs. Geoinformation
Baili Chen, Hongwei Zheng, Lili Wang, Olaf Hellwich, Chunbo Chen, Liao Yang, Tie Liu, Geping Luo, Anming Bao, Xi Chen
2022 conf
ECCV (39)
Marah Halawa, Olaf Hellwich, Pia Bideau
2022 J jnl
CoRR
Marah Halawa, Olaf Hellwich, Pia Bideau
2022 J jnl
CoRR
Tianyi Hu, Monika Kwiatkowski, Simon Matern, Olaf Hellwich
2022 conf
VISIGRAPP (Revised Selected Papers)
Monika Kwiatkowski, Simon Matern, Olaf Hellwich
2022 J jnl
IEEE Access
Jan Botsch, Hardik Jain, Olaf Hellwich
2022 J jnl
CoRR
Dominik Kuhnke, Monika Kwiatkowski, Olaf Hellwich
2022 conf
VISIGRAPP (4: VISAPP)
Monika Kwiatkowski, Olaf Hellwich
2021 J jnl
IEEE Open J. Circuits Syst.
Suhas Shivapakash, Hardik Jain, Olaf Hellwich, Friedel Gerfers
2021 J jnl
CoRR
Nicolas Roth, Pia Bideau, Olaf Hellwich, Martin Rolfs, Klaus Obermayer
2021 J jnl
Remote. Sens.
Haiyang Shi, Qun Pan, Geping Luo, Olaf Hellwich, Chunbo Chen, Tim Van de Voorde, Alishir Kurban, Philippe De Maeyer, Shixin Wu
2021 C conf
IGARSS
Olivier D'Hondt, Olaf Hellwich
2021 conf
EMBC
Reham Elnabawy, Slim Abdennadher, Olaf Hellwich, Seif Eldawlatly
2021 J jnl
IEEE Geosci. Remote. Sens. Lett.
Ronny Hänsch, Olaf Hellwich
2021 conf
3DV
Hardik Jain, Olaf Hellwich
2021 J jnl
IEEE Access
Ahmed J. Afifi, Jannes Magnusson, Toufique Ahmed Soomro, Olaf Hellwich
2021 conf
DeLTA
Jannes Magnusson, Ahmed J. Afifi, Shengjia Zhang, Andreas Ley, Olaf Hellwich
2020 C conf
ISCAS
Suhas Shivapakash, Hardik Jain, Olaf Hellwich, Friedel Gerfers
2020 J jnl
CoRR
Marah Halawa, Manuel Wöllhaf, Eduardo Vellasques, Urko Sánchez Sanz, Olaf Hellwich
2020 conf
VISIGRAPP (5: VISAPP)
Ahmed J. Afifi, Olaf Hellwich, Toufique Ahmed Soomro
2020 conf
VISIGRAPP (4: VISAPP)
Hardik Jain, Olaf Hellwich, Andreas Rose, Nicholas Norman, Dirk Mucha, Timo Krüger
2020 C conf
IGARSS
Tim Davis, V. Jain, Andreas Ley, Olivier D'Hondt, Sébastien Valade, Olaf Hellwich
2019 conf
CVC (1)
Nader H. Aldeeb, Olaf Hellwich
2019 conf
CVPR Workshops
Oleksandra Bielova, Ronny Hänsch, Andreas Ley, Olaf Hellwich
2019 A conf
WACV
Ronny Hänsch, Philipp Wiesner, Sophie Wendler, Olaf Hellwich
2019 J jnl
IEEE Access
Toufique Ahmed Soomro, Ahmed J. Afifi, Lihong Zheng, Shafiullah Soomro, Junbin Gao, Olaf Hellwich, Manoranjan Paul
2019 conf
ICCV Workshops
Hardik Jain, Manuel Wöllhaf, Olaf Hellwich
2019 C conf
IGARSS
Ronny Hänsch, Olaf Hellwich
2019 conf
JURSE
Ronny Hänsch, Olaf Hellwich
2019 J jnl
Expert Syst. Appl.
Toufique Ahmed Soomro, Ahmed J. Afifi, Junbin Gao, Olaf Hellwich, Lihong Zheng, Manoranjan Paul
2019 conf
SITIS
Jens Krenzin, Olaf Hellwich
2019 C conf
IGARSS
Ronny Hänsch, Olaf Hellwich
2019 J jnl
Remote. Sens.
Sébastien Valade, Andreas Ley, Francesco Massimetti, Olivier D'Hondt, Marco Laiolo, Diego Coppola, David Loibl, Olaf Hellwich, Thomas R. Walter
2018 C conf
IGARSS
Ronny Hänsch, Olaf Hellwich
2018 conf
ICIAR
Jeremias Eichelbaum, Ronny Hänsch, Olaf Hellwich
2018 J jnl
ISPRS Int. J. Geo Inf.
Ronny Hänsch, Olaf Hellwich
2018 J jnl
Remote. Sens.
Olivier D'Hondt, Ronny Hänsch, Nicolas Wagener, Olaf Hellwich
2018 C conf
IGARSS
Olivier D'Hondt, Ronny Hänsch, Olaf Hellwich
2018 conf
VISIGRAPP (5: VISAPP)
Manuel Wöllhaf, Ronny Hänsch, Olaf Hellwich
2018 J jnl
IEEE Trans. Geosci. Remote. Sens.
Olivier D'Hondt, Carlos López-Martínez, Stéphane Guillaso, Olaf Hellwich
2018 conf
VISIGRAPP (Revised Selected Papers)
Helge Mohn, Mark Gaebelein, Ronny Hänsch, Olaf Hellwich
2018 conf
VISIGRAPP (5: VISAPP)
Nader H. Aldeeb, Olaf Hellwich
2018 J jnl
IEEE J. Sel. Top. Appl. Earth Obs. Remote. Sens.
Andreas Ley, Olivier D'Hondt, Olaf Hellwich
2018 conf
VISIGRAPP (5: VISAPP)
Ahmed J. Afifi, Olaf Hellwich, Toufique Ahmed Soomro
2018 Misc conf
DICTA
Toufique Ahmed Soomro, Olaf Hellwich, Ahmed J. Afifi, Manoranjan Paul, Junbin Gao, Lihong Zheng
2018 conf
VISIGRAPP (4: VISAPP)
Helge Mohn, Mark Gaebelein, Ronny Hänsch, Olaf Hellwich
2017 B conf
CBMS
Harshita Sharma, Norman Zerbe, Christine Boger, Stephan Wienert, Olaf Hellwich, Peter Hufnagl
2017 Misc conf
DICTA
Toufique Ahmed Soomro, Ahmed J. Afifi, Junbin Gao, Olaf Hellwich, Mohammad A. U. Khan, Manoranjan Paul, Lihong Zheng
2017 C conf
IGARSS
Ronny Hänsch, Andreas Ley, Olaf Hellwich
2017 J jnl
Comput. Medical Imaging Graph.
Harshita Sharma, Norman Zerbe, Iris Klempert, Olaf Hellwich, Peter Hufnagl
2017 conf
VISIGRAPP (6: VISAPP)
Nader H. Aldeeb, Olaf Hellwich
2017 C conf
IGARSS
Olivier D'Hondt, Carlos López-Martínez, Stéphane Guillaso, Olaf Hellwich
2017 conf
VISIGRAPP (5: VISAPP)
Ronny Hänsch, Stefan Kaiser, Olaf Hellwich
2017 ch.
Encyclopedia of GIS
Olaf Hellwich
2017 C conf
IGARSS
Andreas Ley, Olivier D'Hondt, Olaf Hellwich
2017 conf
VISIGRAPP (4: VISAPP)
Irina Nurutdinova, Ronny Hänsch, Vincent Mühler, Stavroula Bourou, Alexandra I. Papadaki, Olaf Hellwich
2016 J jnl
Comput. Chem. Eng.
Johannes Kamp, Ronny Hänsch, Gregor Kendzierski, Matthias Kraume, Olaf Hellwich
2016 conf
ICETE (Selected Papers)
M. A. A. Rajput, Eugen Funk, Anko Börner, Olaf Hellwich
2016 conf
Digital Pathology
Harshita Sharma, Norman Zerbe, Daniel Heim, Stephan Wienert, Sebastian Lohmann, Olaf Hellwich, Peter Hufnagl
2016 conf
GCPR
Andreas Ley, Olaf Hellwich
2016 C conf
FUSION
Hardik Jain, Olaf Hellwich, R. S. Anand
2016 C conf
IGARSS
Ronny Hänsch, Olaf Hellwich, Xiaohong Tu
2016 Misc conf
DICTA
Ahmed J. Afifi, Olaf Hellwich
2016 conf
SIGMAP
M. A. A. Rajput, Eugen Funk, Anko Börner, Olaf Hellwich
2016 conf
GCPR
Jens Krenzin, Olaf Hellwich
2016 conf
ECCV (7)
Andreas Ley, Ronny Hänsch, Olaf Hellwich
2016 C conf
IGARSS
Ronny Hänsch, Olaf Hellwich
2015 conf
VISAPP (3)
Harshita Sharma, Norman Zerbe, Daniel Heim, Stephan Wienert, Hans-Michael Behrens, Olaf Hellwich, Peter Hufnagl
2015 C conf
BIBE
Harshita Sharma, Norman Zerbe, Iris Klempert, Sebastian Lohmann, Björn Lindequist, Olaf Hellwich, Peter Hufnagl
2015 J jnl
Ind. Robot
Boxin Zhao, Olaf Hellwich, Tianjiang Hu, Dianle Zhou, Yifeng Niu, Lincheng Shen
2015 C conf
IGARSS
Ronny Hänsch, Olaf Hellwich
2015 conf
WHISPERS
Ronny Hänsch, Olaf Hellwich
2015 conf
IVAPP
Ronny Hänsch, Olaf Hellwich
2015 conf
VISAPP (2)
Elisavet Konstantina Stathopoulou, Ronny Hänsch, Olaf Hellwich
2015 C conf
IGARSS
Stéphane Guillaso, Olivier D'Hondt, Olaf Hellwich
2015 conf
VISAPP (3)
Tilman Wekel, Olaf Hellwich
2014 C conf
IGARSS
Marc Jäger, Andreas Reigber, Olaf Hellwich
2014 conf
VISAPP (1)
Xi Wang, Ronny Hänsch, Lizhuang Ma, Olaf Hellwich
2014 C conf
IGARSS
Ronny Hänsch, Olaf Hellwich, Xi Wang
2014 C conf
IGARSS
Olivier D'Hondt, Stéphane Guillaso, Olaf Hellwich
2014 C conf
IGARSS
Stéphane Guillaso, Olivier D'Hondt, Olaf Hellwich
2013 C conf
ICVS
Stefan Fuchs, Michael Suppa, Olaf Hellwich
2013 Misc conf
IbPRIA
Olaf Hellwich, Cornelius Wefelscheid, Jakub Lukaszewicz, Ronny Hänsch, Muhammad Adnan Siddique, Adam Stanski
2013 J jnl
CoRR
Olivier D'Hondt, Stéphane Guillaso, Olaf Hellwich
2013 J jnl
IEEE J. Sel. Top. Appl. Earth Obs. Remote. Sens.
Olivier D'Hondt, Stéphane Guillaso, Olaf Hellwich
2013 conf
VISAPP (2)
Cornelius Wefelscheid, Olaf Hellwich
2012 J jnl
IEEE Trans. Geosci. Remote. Sens.
Esra Erten, Andreas Reigber, Laurent Ferro-Famil, Olaf Hellwich
2012 C conf
IGARSS
Olivier D'Hondt, Stéphane Guillaso, Olaf Hellwich
2012 C conf
IGARSS
Muhammad Adnan Siddique, M. Saquib Sarfraz, David Bornemann, Olaf Hellwich
2012 C conf
IGARSS
Olivier D'Hondt, Stéphane Guillaso, Olaf Hellwich
2012 C conf
IGARSS
Stéphane Guillaso, Olivier D'Hondt, Olaf Hellwich
2012 conf
IPTA
Merza Klaghstan, Ronny Hänsch, David Coquil, Olaf Hellwich
2012 conf
ACCV (2)
Tilman Wekel, Olaf Hellwich
2011 conf
CAIP (1)
Tilman Wekel, Olaf Hellwich
2011 conf
VISAPP
Cornelius Wefelscheid, Tilman Wekel, Olaf Hellwich
2011 conf
MIUA
Peter Leskovski, Olaf Hellwich
2010 C conf
IGARSS
Esra Erten, Andreas Reigber, Olaf Hellwich
2010 J jnl
Image Vis. Comput.
M. Saquib Sarfraz, Olaf Hellwich
2010 C conf
IGARSS
Ronny Hänsch, Olaf Hellwich
2010 conf
DAGM-Symposium
Tilman Wekel, Olaf Hellwich
2009 J jnl
Ann. GIS
Volker Rodehorst, Matthias Heinrichs, Olaf Hellwich
2009 conf
IGARSS (4)
Esra Erten, Andreas Reigber, Olaf Hellwich, Pau Prats
2009 conf
IGARSS (4)
Wenju He, Olaf Hellwich
2009 J jnl
IEEE Trans. Geosci. Remote. Sens.
Esra Erten, Andreas Reigber, Olaf Hellwich, Pau Prats
2009 conf
IGARSS (3)
Ronny Hänsch, Olaf Hellwich
2009 conf
IGARSS (4)
Wenju He, Marc Jäger, Olaf Hellwich
2008 conf
IGARSS (1)
Wenju He, Marc Jäger, Olaf Hellwich
2008 conf
VISAPP (1)
M. Saquib Sarfraz, Olaf Hellwich
2008 conf
VISIGRAPP (Selected Papers)
M. Saquib Sarfraz, Olaf Hellwich
2008 ch.
Encyclopedia of GIS
Olaf Hellwich
2008 B conf
FG
M. Saquib Sarfraz, Olaf Hellwich
2007 A* conf
CVPR
Anke Bellmann, Olaf Hellwich, Volker Rodehorst, Ulas Yilmaz
2007 conf
VISAPP (1)
Hongwei Zheng, Olaf Hellwich
2007 A conf
ICME
Hongwei Zheng, Olaf Hellwich
2007 conf
DAGM-Symposium
Hongwei Zheng, Olaf Hellwich
2007 C conf
IGARSS
Esra Erten, Andreas Reigber, Marc Jäger, Olaf Hellwich
2007 C conf
IGARSS
Marc Jäger, Andreas Reigber, Olaf Hellwich
2006 conf
ICICIC (2)
Hongwei Zheng, Olaf Hellwich
2006 conf
ACCV (2)
Hongwei Zheng, Olaf Hellwich
2006 C conf
IWCIA
Hongwei Zheng, Olaf Hellwich
2006 conf
CVPR Workshops
Volker Rodehorst, Olaf Hellwich
2006 conf
DAGM-Symposium
Hongwei Zheng, Olaf Hellwich
2006 conf
VISAPP (1)
Hongwei Zheng, Olaf Hellwich
2005 J jnl
Inf. Fusion
Paolo Gamba, Olaf Hellwich, Pierfrancesco Lombardo
2005 C conf
IGARSS
Marc Jäger, Olaf Hellwich
2005 conf
DAGM-Symposium
Adam Stanski, Olaf Hellwich
2004 conf
DAGM-Symposium
Martin Gruendig, Olaf Hellwich
2002 C conf
IGARSS
Franz J. Meyer, Olaf Hellwich
2002 C conf
IGARSS
Olaf Hellwich, Andreas Reigber, Hartmut Lehmann
1997
Olaf Hellwich
1996 conf
ICIP (3)
Olaf Hellwich, Helmut Mayer
redb/extractors/database_exporters.py
← Index redb/extractors/database_exporters.py python
from abc import ABC, abstractmethod
from datetime import datetime, timezone
from dataclasses import asdict
import hashlib
import json
import inspect
from typing import Any, Dict, List, Union
from redb import settings
import traceback
from contextlib import contextmanager

class DatabaseExporter(ABC):
    @abstractmethod
    def export(self, data: Any, **kwargs) -> bool:
        """Export data to the database"""
        pass

class ElasticsearchExporter(DatabaseExporter):
    def __init__(self, logger: Any, index_prefix: str):
        self.client = settings.get_elasticsearch_client()
        self.index_prefix = index_prefix
        self.log = logger

    def export(self, data: Any, **kwargs) -> bool:
        self.log.debug(inspect.currentframe().f_code.co_name)
        if not isinstance(data, list):
            data = [data]
            
        now_t = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S")
        index = kwargs.get('index')
        tag = kwargs.get('tag')
        hashes = kwargs.get('hashes')
        
        for dataclass_ in data:
            try:
                # Convert dataclass to dict and filter out None values
                document = {k: v for k, v in asdict(dataclass_).items() if v is not None}
                
                if tag:
                    document["tag"] = tag
                document |= hashes
                document["timestamp_utc"] = now_t
                document["known_benign"] = kwargs.get('known_benign', False)
                document["known_malicious"] = kwargs.get('known_malicious', False)

                if "_id" in document:
                    tmp_id = document.pop("_id") + document["sha256"]
                    _id = hashlib.sha256(tmp_id.encode()).hexdigest()
                else:
                    _id = document["sha256"]

                doc_dump = json.dumps(document)
                self.client.index(index=index, id=_id, document=doc_dump)
                
            except Exception as e:
                self.log.error(f"Failed to export to Elasticsearch: {e}")
                return False
                
        return True

class PrintExporter(DatabaseExporter):
    """Exporter that prints results instead of uploading to database (for dry-run mode)"""
    def __init__(self, logger: Any, index_prefix: str):
        self.index_prefix = index_prefix
        self.log = logger
        self.log.debug(f"PrintExporter initialized with index_prefix: {index_prefix}")

    def export(self, data: Any, **kwargs) -> bool:
        try:
            import json
            from dataclasses import asdict, is_dataclass

            self.log.debug(f"PrintExporter.export called with data type: {type(data)}")

            if data is None:
                self.log.debug("PrintExporter.export: data is None, returning True")
                return True

            if not isinstance(data, list):
                data = [data]

            for i, item in enumerate(data):
                if is_dataclass(item) and not isinstance(item, type):
                    # Convert dataclass instance to dict
                    try:
                        item_dict = asdict(item)
                        print(json.dumps(item_dict, indent=2, default=str))
                    except Exception as e:
                        self.log.error(f"PrintExporter.export: Error converting dataclass: {e}")
                        print(str(item))
                elif isinstance(item, dict):
                    # Already a dict, print as JSON
                    print(json.dumps(item, indent=2, default=str))
                else:
                    # Fallback for other types
                    print(json.dumps(item, indent=2, default=str) if not isinstance(item, str) else item)

            self.log.debug("PrintExporter.export: completed successfully")
            return True
        except Exception as e:
            self.log.error(f"PrintExporter.export: Failed to print data: {e}")
            return False


class ClickHouseExporter(DatabaseExporter):
    def __init__(self, logger: Any, index_prefix: str, client=None):
        self.index_prefix = index_prefix
        self.log = logger
        self.client = client

    @contextmanager
    def clickhouse_connection(self):
        client = settings.create_clickhouse_client()
        try:
            yield client
        finally:
            try:
                client.close()
            except:
                pass
    # def export(self, data: Any, **kwargs) -> bool:
    #     try:
    #         # Handle multi-table export case
    #         # if isinstance(data, dict) and 'multi_table' in data:
    #         #     for table_name, table_data in data.items():
    #         #         if table_name != 'multi_table' and isinstance(table_data, dict) and 'table' in table_data:
    #         #             self.log.debug(f"Exporting to table: {table_data['table']}")
    #         #             self.log.debug(f"Column names: {table_data['column_names']}")
    #         #             self.log.debug(f"Column types: {table_data['column_type_names']}")
    #         #             self.log.debug(f"Data sample: {table_data['data'][0] if table_data['data'] else 'No data'}")
                        
    #         #             try:
    #         #                 result = self.client.insert(
    #         #                     table_data['table'],
    #         #                     table_data['data'],
    #         #                     column_names=table_data['column_names'],
    #         #                     column_type_names=table_data['column_type_names']
    #         #                 )
    #         #                 if not result:
    #         #                     self.log.error(f"Failed to insert into table {table_data['table']}")
    #         #                     return False
    #         #             except Exception as e:
    #         #                 self.log.error(f"Error inserting into table {table_data['table']}: {e}")
    #         #                 self.log.error(f"Data that caused error: {table_data['data']}")
    #         #                 return False
    #         #     return True

    #         if isinstance(data, dict) and 'multi_table' in data:
    #             for table_name, table_data in data.items():
    #                 if table_name != 'multi_table' and isinstance(table_data, dict) and 'table' in table_data:
    #                     self.log.debug(f"Exporting to table: {table_data['table']}")
                        
    #                     # Validate each row before insert
    #                     for row in table_data['data']:
    #                         for val, col_name, col_type in zip(row, table_data['column_names'], 
    #                                                         table_data['column_type_names']):
    #                             # Check for empty strings
    #                             if isinstance(val, str) and not val:
    #                                 self.log.error(f"Empty string found for column {col_name}")
    #                                 raise ValueError(f"Empty string not allowed for column {col_name}")
                                
    #                             # Log all string values for certificate_serial_number
    #                             if col_name == 'certificate_serial_number':
    #                                 self.log.debug(f"Serial number value: '{val}', type: {type(val)}, "
    #                                             f"repr: {repr(val)}")
                        
    #                     try:
    #                         result = self.client.insert(
    #                             table_data['table'],
    #                             table_data['data'],
    #                             column_names=table_data['column_names'],
    #                             column_type_names=table_data['column_type_names']
    #                         )
    #                         if not result:
    #                             self.log.error(f"Failed to insert into table {table_data['table']}")
    #                             return False
    #                     except Exception as e:
    #                         self.log.error(f"Error inserting into table {table_data['table']}: {e}")
    #                         self.log.error(f"Data that caused error: {table_data['data']}")
    #                         return False
    #             return True

    #         # Handle single table case
    #         table = kwargs.get('table')
    #         if not table:
    #             raise ValueError("Table name must be provided for ClickHouse export")
            
    #         # Unpack the tuple returned by prepare_export_data
    #         if isinstance(data, tuple):
    #             if len(data) != 3:
    #                 raise ValueError("Data tuple must contain exactly 3 elements: (data, column_names, column_type_names)")
    #             insert_data, column_names, column_type_names = data
    #         else:
    #             # Use provided column names and types from kwargs
    #             insert_data = data
    #             column_names = kwargs.get('column_names')
    #             column_type_names = kwargs.get('column_type_names')
                
    #         if not (column_names and column_type_names):
    #             raise ValueError("column_names and column_type_names must be provided")

    #         # Ensure data is in list format for batch insert
    #         if not isinstance(insert_data, list):
    #             insert_data = [insert_data]
                
    #         self.client.insert(
    #             table,
    #             insert_data,
    #             column_names=column_names,
    #             column_type_names=column_type_names
    #         )
    #         return True
            
    #     except Exception as e:
    #         self.log.error(f"Failed to export to ClickHouse: {e}")
    #         return False

    def get_client(self):
        """Get existing client or create new one if needed"""
        if self.client:
            return self.client
        try:
            return settings.create_clickhouse_client() 
        except Exception as e:
            self.log.error(f"Failed to create ClickHouse client: {e}")
            return None
            
    # WORKING SIMPLE VERSION
    def export(self, data: Any, **kwargs) -> bool:
        try:
            # # Handle multi-table export case
            # # if isinstance(data, dict) and 'multi_table' in data:
            # #     for table_data in data.values():
            # #         if isinstance(table_data, dict) and 'table' in table_data:
            # #             result = self.client.insert(
            # #                 table_data['table'],
            # #                 table_data['data'],
            # #                 column_names=table_data['column_names'],
            # #                 column_type_names=table_data['column_type_names']
            # #             )
            # #             if not result:  # If any insert fails, return False
            # #                 return False
            # #     return True
            # if isinstance(data, dict) and 'multi_table' in data:
            #     for key, table_data in data.items():
            #         if key != 'multi_table' and isinstance(table_data, dict) and 'table' in table_data:
            #             # Add type hints
            #             typed_data = []
            #             for row in table_data['data']:
            #                 typed_row = []
            #                 for val, type_name in zip(row, table_data['column_type_names']):
            #                     if isinstance(val, str) and not val:
            #                         val = 'UNKNOWN'
            #                     if type_name == 'String' or 'LowCardinality(String)' in type_name:
            #                         val = str(val) if val is not None else 'UNKNOWN'
            #                     typed_row.append(val)
            #                 typed_data.append(typed_row)
                        
            #             table_data['data'] = typed_data
                        
            #             result = self.client.insert(
            #                 table_data['table'],
            #                 table_data['data'],
            #                 column_names=table_data['column_names'],
            #                 column_type_names=table_data['column_type_names'],
            #                 settings={'input_format_values_interpret_expressions': 0}  # Disable type inference
            #             )
            #             if not result:
            #                 return False
            #         return True

            # Get a new client connection for this export operation
            with self.clickhouse_connection() as client:
                if not client:
                    return False

                # LAST WORKING VERSION
                if isinstance(data, dict) and 'multi_table' in data:
                    for key, table_data in data.items():
                        if key != 'multi_table' and isinstance(table_data, dict) and 'table' in table_data:
                            # Debug logging
                            self.log.debug(f"Processing table: {table_data['table']}")
                            self.log.debug(f"Column names: {table_data['column_names']}")
                            self.log.debug(f"Column types: {table_data['column_type_names']}")
                            
                            typed_data = []
                            for row_idx, row in enumerate(table_data['data']):
                                typed_row = []
                                for val_idx, (val, type_name, col_name) in enumerate(
                                    zip(row, table_data['column_type_names'], table_data['column_names'])
                                ):
                                    try:
                                        # Handle different types
                                        if val is None:
                                            if 'Nullable' in type_name:
                                                val = None  # Keep None for Nullable columns
                                            elif 'Array' in type_name:
                                                val = []
                                            elif 'Int' in type_name or 'UInt' in type_name:
                                                val = 0
                                            elif 'FixedString(16)' in type_name:
                                                val = b'\x00' * 16  # Binary FixedString
                                            elif 'String' in type_name or 'LowCardinality' in type_name:
                                                val = 'UNKNOWN'
                                            elif 'DateTime' in type_name:
                                                val = datetime.now(timezone.utc)
                                            elif 'Boolean' in type_name:
                                                val = False
                                            else:
                                                self.log.error(f"Unhandled type {type_name} for null value")
                                                val = 'UNKNOWN'
                                        
                                        # Log problematic values
                                        if isinstance(val, str) and not val.strip():
                                            self.log.warning(f"Empty string found in table {table_data['table']}, "
                                                        f"column {col_name}, row {row_idx}")
                                        
                                        # Ensure array types are always lists
                                        if 'Array' in type_name and not isinstance(val, list):
                                            val = [val]
                                        
                                        typed_row.append(val)
                                    except Exception as e:
                                        self.log.error(f"Error processing value in table {table_data['table']}, "
                                                    f"column {col_name} ({type_name}), "
                                                    f"row {row_idx}, value: {repr(val)}")
                                        raise
                                        
                                typed_data.append(typed_row)
                            
                            table_data['data'] = typed_data

                            # Skip insert if there is nothing to insert
                            if not typed_data:
                                self.log.debug(f"No data to insert for table {table_data['table']}, skipping.")
                                continue

                            # Debug log the first row of data
                            self.log.debug(f"Sample row for {table_data['table']}: {typed_data[0]}")

                            result = client.insert(
                                table_data['table'],
                                table_data['data'],
                                column_names=table_data['column_names'],
                                column_type_names=table_data['column_type_names'],
                                settings={'input_format_values_interpret_expressions': 0}
                            )
                            if not result:
                                self.log.error(f"Insert failed for table {table_data['table']}")
                                return False
                    return True

                # Handle single table case
                table = kwargs.get('table')
                if not table:
                    raise ValueError("Table name must be provided for ClickHouse export")
                
                # Unpack the tuple returned by prepare_export_data
                if isinstance(data, tuple):
                    if len(data) != 3:
                        raise ValueError("Data tuple must contain exactly 3 elements: (data, column_names, column_type_names)")
                    insert_data, column_names, column_type_names = data
                else:
                    # Use provided column names and types from kwargs
                    insert_data = data
                    column_names = kwargs.get('column_names')
                    column_type_names = kwargs.get('column_type_names')
                    
                if not (column_names and column_type_names):
                    raise ValueError("column_names and column_type_names must be provided")

                # Ensure data is in list format for batch insert
                if not isinstance(insert_data, list):
                    insert_data = [insert_data]

                # Skip insert if there is nothing to insert
                if not insert_data:
                    self.log.debug(f"No data to insert for table {table}, skipping.")
                    return True

                client.insert(
                    table,
                    insert_data,
                    column_names=column_names,
                    column_type_names=column_type_names,
                    settings={'input_format_values_interpret_expressions': 0}  # Disable type inference
                )
                return True

        except TypeError as e:
            # Get the actual value causing the error from the exception traceback
            import sys
            exc_type, exc_value, exc_traceback = sys.exc_info()
            
            # Walk through the traceback to find the frame with the problematic value
            current = exc_traceback
            while current:
                if 'string.py' in current.tb_frame.f_code.co_filename and '_data_size' in current.tb_frame.f_code.co_name:
                    locals_dict = current.tb_frame.f_locals
                    problematic_value = locals_dict.get('x')
                    self.log.error(f"TypeError with value: {problematic_value} (type: {type(problematic_value)})")
                    self.log.error(f"Full locals at error: {locals_dict}")
                    break
                current = current.tb_next
            
            self.log.error(f"Failed to export to ClickHouse: {e}")
            self.log.error("Full traceback:")
            self.log.error(traceback.format_exc())
            return False
        except Exception as e:
            self.log.error(f"Failed to export to ClickHouse: {e}")
            self.log.error(traceback.format_exc())
            return False
        finally:
            # Only close if we created a new client
            if client and client != self.client:
                # Close the client connection
                try:
                    client.close()
                except:
                    pass