Skip to content

Commit

Permalink
Add debug logging on columns read/write #404
Browse files Browse the repository at this point in the history
  • Loading branch information
xzkostyan committed Aug 7, 2024
1 parent 8d2cf95 commit 13a8ba0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clickhouse_driver/streams/native.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import logging

from ..block import ColumnOrientedBlock, BlockInfo
from ..columns.service import read_column, write_column
from ..reader import read_binary_str, read_binary_uint8
from ..varint import write_varint, read_varint
from ..writer import write_binary_str, write_binary_uint8
from .. import defines

logger = logging.getLogger(__name__)


class BlockOutputStream(object):
def __init__(self, fout, context):
Expand Down Expand Up @@ -40,6 +44,7 @@ def write(self, block):
# We write always sparse data without custom serialization.
write_binary_uint8(0, self.fout)

logger.debug('Writing column %s', col_name)
write_column(self.context, col_name, col_type, items,
self.fout, types_check=block.types_check)

Expand Down Expand Up @@ -80,6 +85,7 @@ def read(self, use_numpy=None):
has_custom_serialization = bool(read_binary_uint8(self.fin))

if n_rows:
logger.debug('Reading column %s', column_name)
column = read_column(
self.context, column_type, n_rows,
self.fin, use_numpy=use_numpy,
Expand Down

0 comments on commit 13a8ba0

Please sign in to comment.