Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-2392

[Python] pyarrow RecordBatchStreamWriter allows writing batches with different schemas

    XMLWordPrintableJSON

Details

    Description

      A RecordBatchStreamWriter initialised with a given schema will still allow writing RecordBatches that have different schemas. Example:

       

      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()
      

      Attachments

        Issue Links

          Activity

            People

              apitrou Antoine Pitrou
              ocampoernesto Ernesto Ocampo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m