Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
688831c
chdb support parallel execution step1
kafka1991 Oct 14, 2025
0f44885
go on parallel execute
kafka1991 Oct 15, 2025
7a4f26f
go on
kafka1991 Oct 21, 2025
93de74b
Refactor ChdbClient and EmbeddedServer to use shared_ptr for better m…
kafka1991 Oct 22, 2025
332f356
Merge branch 'main' into parallel_sql_executed
kafka1991 Oct 22, 2025
3667c53
go on
kafka1991 Oct 22, 2025
d86144d
fix compile issue
kafka1991 Oct 23, 2025
1bcae6e
fix tests
kafka1991 Oct 23, 2025
d3e45fb
Enhance stdin handling in isStdinNotEmptyAndValid
kafka1991 Oct 24, 2025
e0d4e2a
merge master
kafka1991 Oct 24, 2025
60eb579
arrow stream
kafka1991 Oct 27, 2025
e1fa11a
remove arrow mutex
kafka1991 Oct 27, 2025
991fea7
fix embeeded server
kafka1991 Oct 27, 2025
932db48
fix more tests
kafka1991 Oct 28, 2025
da27856
python table cache clean up
kafka1991 Oct 28, 2025
787cfbf
compile error
kafka1991 Oct 28, 2025
fd54364
Refactor PythonTableCache usage
kafka1991 Oct 28, 2025
48c9f4f
revert changes
kafka1991 Oct 29, 2025
0dc3725
code lint
kafka1991 Oct 29, 2025
9f6a2c0
Remove libsqlite3-dev from build dependencies for Linux wheels
kafka1991 Oct 29, 2025
014095c
continue when SQLite vulnerabilities
kafka1991 Oct 29, 2025
034eb19
make session thread safe
kafka1991 Oct 29, 2025
74111fd
fix more tests
kafka1991 Oct 29, 2025
0c1d0fd
add multi sessions tests
kafka1991 Oct 29, 2025
0889774
skip tests for musl
kafka1991 Oct 29, 2025
0084692
make session thread-safe
kafka1991 Nov 2, 2025
29f486e
merge main
kafka1991 Nov 3, 2025
fffb462
replace local once_flag with global once_flag for interpreter registr…
kafka1991 Nov 3, 2025
45a63ff
revert build.sh
kafka1991 Nov 3, 2025
b89aba5
merge main
kafka1991 Nov 3, 2025
ba81bcc
Merge branch 'main' into parallel_sql_executed
kafka1991 Nov 3, 2025
d3386a9
Merge branch 'main' into parallel_sql_executed
kafka1991 Nov 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_linux_arm64_wheels-gh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libbz2-dev libreadline-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev \
libffi-dev liblzma-dev
- name: Scan SQLite vulnerabilities with grype
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_linux_x86_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libbz2-dev libreadline-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev \
libffi-dev liblzma-dev
- name: Scan SQLite vulnerabilities with grype
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
else
echo "✅ No SQLite vulnerabilities found"
fi
continue-on-error: true
continue-on-error: true
- name: Setup pyenv
run: |
curl https://pyenv.run | bash
Expand Down
24 changes: 5 additions & 19 deletions chdb/session/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
from ..state import sqlitelike as chdb_stateful
from ..state.sqlitelike import StreamingResult

g_session = None
g_session_path = None


class Session:
"""
Expand Down Expand Up @@ -35,21 +32,15 @@ class Session:
- "mode=ro" would be "--readonly=1" for clickhouse (read-only mode)

Important:
- There can be only one session at a time. If you want to create a new session, you need to close the existing one.
- Creating a new session will close the existing one.
- Multiple sessions can coexist. Each session has its own connection and database context.
- Sessions are thread-safe: Multiple threads can safely use the same session concurrently.
- Internal mutexes protect concurrent access to the underlying connection and client.
- For optimal performance in multi-threaded scenarios, consider creating a separate session for each thread
to avoid lock contention, though sharing a session across threads is safe.
"""

def __init__(self, path=None):
self._conn = None
global g_session, g_session_path
if g_session is not None:
warnings.warn(
"There is already an active session. Creating a new session will close the existing one. "
"It is recommended to close the existing session before creating a new one. "
f"Closing the existing session {g_session_path}"
)
g_session.close()
g_session_path = None
if path is None:
self._path = ":memory:"
else:
Expand All @@ -68,8 +59,6 @@ def __init__(self, path=None):
self._udf_path = ""
self._conn_str = f"{self._path}"
self._conn = chdb_stateful.Connection(self._conn_str)
g_session = self
g_session_path = self._path

def __del__(self):
self.close()
Expand Down Expand Up @@ -102,9 +91,6 @@ def close(self):
if self._conn is not None:
self._conn.close()
self._conn = None
global g_session, g_session_path
g_session = None
g_session_path = None

def cleanup(self):
"""Cleanup session resources with exception handling.
Expand Down
2 changes: 1 addition & 1 deletion contrib/corrosion-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ endfunction()
function(clickhouse_config_crate_flags target_name)
corrosion_set_env_vars(${target_name} "CFLAGS=${RUST_CFLAGS}")
corrosion_set_env_vars(${target_name} "CXXFLAGS=${RUST_CXXFLAGS}")
corrosion_set_env_vars(${target_name} "RUSTFLAGS=${RUSTFLAGS}")
corrosion_set_env_vars(${target_name} "RUSTFLAGS=${RUSTFLAGS} --cfg osslconf=\"OPENSSL_NO_DEPRECATED_3_0\"")
corrosion_set_env_vars(${target_name} "RUSTDOCFLAGS=${RUSTFLAGS}")
if (CMAKE_OSX_SYSROOT)
corrosion_set_env_vars(${target_name} "SDKROOT=${CMAKE_OSX_SYSROOT}")
Expand Down
5 changes: 4 additions & 1 deletion programs/local/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set (CLICKHOUSE_LOCAL_SOURCES
ArrowStreamWrapper.cpp
ArrowTableReader.cpp
LocalServer.cpp
EmbeddedServer.cpp
ChdbClient.cpp
)

if (NOT USE_PYTHON)
Expand All @@ -25,10 +27,11 @@ endif()
if (USE_PYTHON)
set (CHDB_SOURCES
chdb.cpp
FormatHelper.cpp
ListScan.cpp
LocalChdb.cpp
LocalServer.cpp
EmbeddedServer.cpp
ChdbClient.cpp
NumpyType.cpp
PandasAnalyzer.cpp
PandasDataFrame.cpp
Expand Down
Loading
Loading