Skip to content

pyarrow: Parquet segfaults if coercing ns timestamps and writing 96-bit timestamps #1498

@dargueta

Description

@dargueta

If you try to write a PyArrow table containing nanosecond-resolution timestamps to Parquet using coerce_timestamps and use_deprecated_int96_timestamps=True, the Arrow library will segfault.

The crash doesn't happen if you don't coerce the timestamp resolution or if you don't use 96-bit timestamps.

Machine Info

OS: Mac OS X 10.13.2
Python: 3.6.4
PyArrow: 0.8.0

To Reproduce

import datetime

import pyarrow
from pyarrow import parquet

schema = pyarrow.schema([
    pyarrow.field('last_updated', pyarrow.timestamp('ns')),
])

data = [
    pyarrow.array([datetime.datetime.now()], pyarrow.timestamp('ns')),
]

table = pyarrow.Table.from_arrays(data, ['last_updated'])

with open('test_file.parquet', 'wb') as fdesc:
    parquet.write_table(table, fdesc,
                        coerce_timestamps='us',
                        use_deprecated_int96_timestamps=True)

Crash Report

See attached file for full crash report from OSX: crash-report.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions