You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Antoine Pitrou (JIRA)" <ji...@apache.org> on 2019/02/26 15:01:00 UTC

[jira] [Assigned] (ARROW-2392) [Python] pyarrow RecordBatchStreamWriter allows writing batches with different schemas

     [ https://issues.apache.org/jira/browse/ARROW-2392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antoine Pitrou reassigned ARROW-2392:
-------------------------------------

    Assignee: Antoine Pitrou

> [Python] pyarrow RecordBatchStreamWriter allows writing batches with different schemas
> --------------------------------------------------------------------------------------
>
>                 Key: ARROW-2392
>                 URL: https://issues.apache.org/jira/browse/ARROW-2392
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>            Reporter: Ernesto Ocampo
>            Assignee: Antoine Pitrou
>            Priority: Minor
>             Fix For: 0.13.0
>
>
> A RecordBatchStreamWriter initialised with a given schema will still allow writing RecordBatches that have different schemas. Example:
>  
> {code:java}
> schema = pa.schema([pa.field('some_field', pa.int64())])
> stream = pa.BufferOutputStream()
> writer = pa.RecordBatchStreamWriter(stream, schema)
> data = [pa.array([1.234])]
> batch = pa.RecordBatch.from_arrays(data, ['some_field'])  
> # batch does not conform to schema
> assert batch.schema != schema
> writer.write_batch(batch)  # no exception raised
> writer.close()
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)