@@ -10,9 +10,12 @@ sf::CArrowChunkIterator::CArrowChunkIterator()
1010 this ->reset ();
1111}
1212
13- void sf::CArrowChunkIterator::addRecordBatch (std::shared_ptr<arrow::RecordBatch> rb)
13+ void sf::CArrowChunkIterator::addRecordBatch (PyObject * rb)
1414{
15- m_cRecordBatches.push_back (rb);
15+ std::shared_ptr<arrow::RecordBatch> cRecordBatch;
16+ arrow::Status status = arrow::py::unwrap_record_batch (rb, &cRecordBatch);
17+
18+ m_cRecordBatches.push_back (cRecordBatch);
1619 m_columnCount = m_cRecordBatches[0 ]->num_columns ();
1720 m_batchCount = m_cRecordBatches.size ();
1821}
@@ -44,7 +47,7 @@ PyObject * sf::CArrowChunkIterator::nextRow()
4447 }
4548 }
4649
47- return NULL ;
50+ return Py_None ;
4851}
4952
5053PyObject * sf::CArrowChunkIterator::currentRowAsTuple ()
@@ -68,6 +71,22 @@ void sf::CArrowChunkIterator::initColumnConverters()
6871 std::shared_ptr<arrow::DataType> dt = schema->field (i)->type ();
6972 switch (dt->id ())
7073 {
74+
75+ case arrow::Type::type::INT8:
76+ m_currentBatchConverters.push_back (
77+ std::make_shared<sf::Int8Converter>(columnArray.get ()));
78+ break ;
79+
80+ case arrow::Type::type::INT16:
81+ m_currentBatchConverters.push_back (
82+ std::make_shared<sf::Int16Converter>(columnArray.get ()));
83+ break ;
84+
85+ case arrow::Type::type::INT32:
86+ m_currentBatchConverters.push_back (
87+ std::make_shared<sf::Int32Converter>(columnArray.get ()));
88+ break ;
89+
7190 case arrow::Type::type::INT64:
7291 m_currentBatchConverters.push_back (
7392 std::make_shared<sf::Int64Converter>(columnArray.get ()));
0 commit comments