()
| 697 | |
| 698 | |
| 699 | def test_batch_serialize(): |
| 700 | batch = make_recordbatch(10) |
| 701 | hbuf = batch.serialize() |
| 702 | cbuf = cuda.serialize_record_batch(batch, global_context) |
| 703 | |
| 704 | # Test that read_record_batch works properly |
| 705 | cbatch = cuda.read_record_batch(cbuf, batch.schema) |
| 706 | assert isinstance(cbatch, pa.RecordBatch) |
| 707 | assert batch.schema == cbatch.schema |
| 708 | assert batch.num_columns == cbatch.num_columns |
| 709 | assert batch.num_rows == cbatch.num_rows |
| 710 | |
| 711 | # Deserialize CUDA-serialized batch on host |
| 712 | buf = cbuf.copy_to_host() |
| 713 | assert hbuf.equals(buf) |
| 714 | batch2 = pa.ipc.read_record_batch(buf, batch.schema) |
| 715 | assert hbuf.equals(batch2.serialize()) |
| 716 | |
| 717 | assert batch.num_columns == batch2.num_columns |
| 718 | assert batch.num_rows == batch2.num_rows |
| 719 | assert batch.column(0).equals(batch2.column(0)) |
| 720 | assert batch.equals(batch2) |
| 721 | |
| 722 | |
| 723 | def make_table(): |
nothing calls this directly
no test coverage detected