-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cursor.fetchallarrow() followed by SegmentationFault #139
Comments
Can you provide us with a backtrace related to the segfault? On Linux you can get it with:
In the then resulting gdb prompt, enter |
It seems I can't Oo... Any idea why?
|
Hello @IceS2! Thanks for reporting! You did well :-). I have a hunch that the As a workaround, you could use |
@IceS2 it could also be that your core is named |
@MathMagique, @xhochy, Sorry for the delayed answer. Wasn't near my computer past weekend! It seems to work with |
What version of FreeTDS and unixODBC are you using? Can you test using the Microsoft ODBC driver for Linux instead of FreeTDS? See: https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server |
Hey @dirkjonker, I've just tested using the Microsoft ODBC driver you mentioned. The result was the same The version of the packages you asked are
|
That's too bad, sometimes switching the driver works to resolve this type of problem. What types of columns are in the table you are selecting from? |
@IceS2 are you on Fedora 24+? There we have a known problem with |
It can be fixed by also building Alternatively, using a conda based installation instead of a pip-based one will work. |
@xhochy, I'm actually running Arch Linux! |
@IceS2 It could be a possible fix. I guess the Fedora problem is due to Turbodbc being compiled with a different C++ ABI than the pyarrow wheel. Rebuilding both with the same ABI should fix the problems. |
Hey @xhochy, Sorry for the late answer. I had to work on other stuff first. |
@IceS2 Hi again! Have you tried using more recent versions of turbodbc/pyarrow in the mean time? Does this fix things? |
Same error, with same line (the last) from turbodbc import connect
import pyarrow
connection = connect(dsn='mysql_DNS_ANSI')
cursor = connection.cursor()
cursor.execute('SELECT col1 from test01;')
table = cursor.fetchallarrow() change last time to print cursor.fetchall() returns:
Can be reproduced with this command: docker run -it albertozgz/turbodbc_extrator:debian9 bash (You only need connect this Docker to your database, I uses MySQL 8.0) TIP1: table=cursor.fetchallnumpy() works fine batches = cursor.fetcharrowbatches()
for batch in batches:
print(batch)
|
@xhochy Would you have the time to look at @albertoRamon 's reproducing example, please? |
This is the same problem as above. Debian 9 builds with by default with a different C++ ABI than the |
Would it work to switch to the conda environment with our "blessed" builds? |
Yes using |
@albertoRamon Could you try using the turbodbc conda package, please? https://anaconda.org/conda-forge/turbodbc |
Yes of course Any test or test that they want to do I can prove it |
Anything too modern will not work because the precompiled pyarrow wheel uses a "classic" version of the ABIs, while pip install turbodbc will compile stuff with the latest and greatest ABIs. Conda packages for turbodbc and pyarrow are built with consistent settings, and should work on any modern system. |
@MathMagique @xhochy , Thanks pip uninstall pyarrow
pip uninstall turbodbc
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
chmod +x Miniconda2-latest-Linux-x86_64.sh
./Miniconda2-latest-Linux-x86_64.sh
conda install -c conda-forge pyarrow
source ~/.bashrc
conda install -c conda-forge pyarrow
conda install -c conda-forge turbodbc python: table = cursor.fetchallarrow()
print table.num_rows
If you think that the best option for production environment is download code from Git and compile it. I will be happy to modify the docker file to realize these steps BR |
I never would download code from Git for production; if anything, download source packages from pypi.org. I'd suggest to go down the conda route for production, however, as this has already solved the hassle of compiling stuff the right way. |
Hello guys, it's the first time I post an Issue on a project, so I'm sorry if I'm doing it the wrong way, please correct me if wrong (=
I'm trying to use turbodbc with pyarrow and I'm running into a segmentation fault issue.
I'm querying a SQLServer database using FreeTDS. After I assign cursor.fetchallarrow() to a variable, it runs automatically into a segmentation fault. If it doesn't run automatically into the segmentation fault, as soon as I try to do anything with that variable it runs into segmentation fault.
My python version and installed packages:
You can use the next code to try to reproduce the issue. I just took off the database credentials.
The text was updated successfully, but these errors were encountered: