chdb-io / chdb

chDB is an in-process OLAP SQL Engine 🚀 powered by ClickHouse
https://clickhouse.com/docs/en/chdb
Apache License 2.0
2.03k stars 72 forks source link

Unhelpful stderr messages #144

Closed nalgeon closed 9 months ago

nalgeon commented 9 months ago

Describe the unexpected behaviour

Importing chdb and running chdb.query on smaller systems result in several "Lowered..." messages being written to stderr. These are not helpful and only obscure the actual errors/exceptions (if any) which are also written to stderr.

How to reproduce

Dockerfile:

FROM python:3.11-slim

RUN pip install "chdb==1.0.0"

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

Build an image:

docker build --tag chdb/python .

Run with 128m of memory:

docker run --rm --memory 128m chdb/python python -c "import chdb;chdb.query('select 42')"

Result (stderr):

Lowered mark cache size to 64.00 MiB because the system has limited RAM
Lowered index mark cache size to 0.00 B because the system has limited RAM
Lowered mark cache size to 64.00 MiB because the system has limited RAM
Lowered index mark cache size to 0.00 B because the system has limited RAM

There is a similar behavior with 256m, 512m or 1024m of memory.

Expected behavior

Do not write these messages to stderr or hide them behind a flag or env variable.

nalgeon commented 9 months ago

Fixed in 1.0.1:

docker run --rm --memory 128m chdb/python python -c "import chdb; chdb.query('select 42'); print(chdb.__version__)"
1.0.1

Thanks for the quick fix!