Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 10 additions & 1 deletion .github/workflows/build_linux_arm64_wheels-gh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
echo "Installing dependencies for Python $version"
pyenv shell $version
python -m pip install --upgrade pip
python -m pip install setuptools tox pandas pyarrow twine psutil deltalake wheel
python -m pip install setuptools tox pandas pyarrow twine psutil deltalake wheel jupyter nbconvert
pyenv shell --unset
done
- name: Install clang++ for Ubuntu
Expand Down Expand Up @@ -250,6 +250,15 @@ jobs:
pyenv shell --unset
done
continue-on-error: false
- name: Run notebook tests
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
pyenv shell 3.8
python -m pip install dist/*.whl --force-reinstall
jupyter nbconvert --to notebook --execute tests/test_data_insertion.ipynb --output test_data_insertion_output.ipynb
pyenv shell --unset
continue-on-error: false
- name: Check and upload core files if present
if: always()
run: |
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/build_linux_x86_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
echo "Installing dependencies for Python $version"
pyenv shell $version
python -m pip install --upgrade pip
python -m pip install setuptools tox pandas pyarrow twine psutil deltalake wheel
python -m pip install setuptools tox pandas pyarrow twine psutil deltalake wheel jupyter nbconvert
pyenv shell --unset
done
- name: Install clang++ for Ubuntu
Expand Down Expand Up @@ -249,6 +249,15 @@ jobs:
pyenv shell --unset
done
continue-on-error: false
- name: Run notebook tests
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
pyenv shell 3.8
python -m pip install dist/*.whl --force-reinstall
jupyter nbconvert --to notebook --execute tests/test_data_insertion.ipynb --output test_data_insertion_output.ipynb
pyenv shell --unset
continue-on-error: false
- name: Check and upload core files if present
if: always()
run: |
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/build_macos_arm64_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
echo "Installing dependencies for Python $version"
pyenv shell $version
python -m pip install --upgrade pip
python -m pip install setuptools wheel tox pandas pyarrow twine psutil deltalake wheel>=0.40.0
python -m pip install setuptools wheel tox pandas pyarrow twine psutil deltalake wheel>=0.40.0 jupyter nbconvert
pyenv shell --unset
done
- name: Remove /usr/local/bin/python3
Expand Down Expand Up @@ -249,6 +249,15 @@ jobs:
pyenv shell --unset
done
continue-on-error: false
- name: Run notebook tests
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
pyenv shell 3.8
python -m pip install dist/*.whl --force-reinstall
jupyter nbconvert --to notebook --execute tests/test_data_insertion.ipynb --output test_data_insertion_output.ipynb
pyenv shell --unset
continue-on-error: false
- name: Check and upload core files if present
if: always()
run: |
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/build_macos_x86_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
echo "Installing dependencies for Python $version"
pyenv shell $version
python -m pip install --upgrade pip
python -m pip install setuptools tox pandas pyarrow twine psutil deltalake wheel>=0.40.0
python -m pip install setuptools tox pandas pyarrow twine psutil deltalake wheel>=0.40.0 jupyter nbconvert
pyenv shell --unset
done
- name: Remove /usr/local/bin/python3
Expand Down Expand Up @@ -248,6 +248,15 @@ jobs:
pyenv shell --unset
done
continue-on-error: false
- name: Run notebook tests
run: |
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
pyenv shell 3.8
python -m pip install dist/*.whl --force-reinstall
jupyter nbconvert --to notebook --execute tests/test_data_insertion.ipynb --output test_data_insertion_output.ipynb
pyenv shell --unset
continue-on-error: false
- name: Check and upload core files if present
if: always()
run: |
Expand Down
15 changes: 15 additions & 0 deletions src/Client/ClientBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,21 @@ bool isStdinNotEmptyAndValid(ReadBuffer & std_in)
{
try
{
// Use non-blocking check for stdin to avoid hanging
if (auto * fd_buffer = typeid_cast<ReadBufferFromFileDescriptor *>(&std_in))
{
int fd = fd_buffer->getFD();
if (fd == STDIN_FILENO)
{
int flags = fcntl(fd, F_GETFL);
if (flags != -1)
{
fcntl(fd, F_SETFL, flags | O_NONBLOCK);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changed the behavior of stdin empty check. The orginal one will block wait for data if not eol found.
I still think this mod is risky while processing large chunk of input data with slow IO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upon confirmation:

  • The std_in check here is only used for INSERT statements on the clickhouse-local client side; engines like CSV read do not use it for reading.

  • The interaction code between Python and C++ does not use the std_in fd

SCOPE_EXIT({ fcntl(fd, F_SETFL, flags); });
return !std_in.eof();
}
}
}
return !std_in.eof();
}
catch (const Exception & e)
Expand Down
Loading
Loading