You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wamsi Viswanath (Jira)" <ji...@apache.org> on 2019/09/05 23:19:00 UTC

[jira] [Commented] (ARROW-6470) [C++] Segmentation fault when trying to serialzie empty SerializeRecordBatch

    [ https://issues.apache.org/jira/browse/ARROW-6470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16923808#comment-16923808 ] 

Wamsi Viswanath commented on ARROW-6470:
----------------------------------------

Thanks, I just wanted to make sure it was the correct behavior.

> [C++] Segmentation fault when trying to serialzie empty SerializeRecordBatch 
> -----------------------------------------------------------------------------
>
>                 Key: ARROW-6470
>                 URL: https://issues.apache.org/jira/browse/ARROW-6470
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++
>    Affects Versions: 0.13.0
>            Reporter: Wamsi Viswanath
>            Priority: Major
>
> Below is a simple reproducible example, please let me know if the behavior is valid:
>  ```
> #include <arrow/api.h>
>  #include <arrow/io/memory.h>
>  #include <arrow/ipc/api.h>
>  #include <cstdio>
>  #include <iostream>
> int main()
> { std::shared_ptr<arrow::Schema> schema = arrow::schema(\\{arrow::field("int_", arrow::int32(), false)}
> );
>  std::vector<std::shared_ptr<arrow::Array>> arrays = {};
> std::shared_ptr<arrow::RecordBatch> record_batch =
>  arrow::RecordBatch::Make(schema, arrays[0]->length(), arrays);
>  std::shared_ptr<arrow::Buffer> serialized_buffer;
>  if (!arrow::ipc::SerializeRecordBatch(
>  *record_batch, arrow::default_memory_pool(), &serialized_buffer)
>  .ok())
> { throw std::runtime_error("Error: Serializing Records."); }
> }
> ```



--
This message was sent by Atlassian Jira
(v8.3.2#803003)