Skip to content

Commit d1236b7

Browse files
committed
table works for double, for timecolumn, but not for timestamp, also issue with the c object life cycle
1 parent 2438502 commit d1236b7

File tree

6 files changed

+549
-1250
lines changed

6 files changed

+549
-1250
lines changed

src/snowflake/connector/cpp/ArrowIterator/CArrowChunkIterator.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,21 @@ void CArrowChunkIterator::initColumnConverters()
123123
int returnCode = ArrowArrayViewInitFromSchema(
124124
m_arrowArrayView.get(), m_arrowSchema.get(), &error);
125125
if (returnCode != NANOARROW_OK) {
126-
std::string errorInfo = Logger::formatString(ArrowErrorMessage(&error));
126+
std::string errorInfo = Logger::formatString(
127+
"[Snowflake Exception] error initializing ArrowArrayView from schema : %s",
128+
ArrowErrorMessage(&error)
129+
);
127130
logger->error(__FILE__, __func__, __LINE__, errorInfo.c_str());
128131
PyErr_SetString(PyExc_Exception, errorInfo.c_str());
129132
}
130133

131134
returnCode = ArrowArrayViewSetArray(
132135
m_arrowArrayView.get(), m_arrowArray.get(), &error);
133136
if (returnCode != NANOARROW_OK) {
134-
std::string errorInfo = Logger::formatString(ArrowErrorMessage(&error));
137+
std::string errorInfo = Logger::formatString(
138+
"[Snowflake Exception] error setting ArrowArrayView from array : %s",
139+
ArrowErrorMessage(&error)
140+
);
135141
logger->error(__FILE__, __func__, __LINE__, errorInfo.c_str());
136142
PyErr_SetString(PyExc_Exception, errorInfo.c_str());
137143
}
@@ -145,7 +151,10 @@ void CArrowChunkIterator::initColumnConverters()
145151
returnCode = ArrowSchemaViewInit(
146152
&columnSchemaView, columnSchema, &error);
147153
if (returnCode != NANOARROW_OK) {
148-
std::string errorInfo = Logger::formatString(ArrowErrorMessage(&error));
154+
std::string errorInfo = Logger::formatString(
155+
"[Snowflake Exception] error initializing ArrowSchemaView : %s",
156+
ArrowErrorMessage(&error)
157+
);
149158
logger->error(__FILE__, __func__, __LINE__, errorInfo.c_str());
150159
PyErr_SetString(PyExc_Exception, errorInfo.c_str());
151160
}

src/snowflake/connector/cpp/ArrowIterator/CArrowIterator.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#include "Python/Common.hpp"
99
#include "logging.hpp"
10+
#include "nanoarrow.hpp"
11+
#include <cstdint>
1012
#include <memory>
1113
#include <string>
1214
#include <vector>
@@ -108,6 +110,8 @@ class CArrowIterator
108110
* @return a python object which might be current row or an Arrow Table
109111
*/
110112
virtual std::shared_ptr<ReturnVal> next() = 0;
113+
virtual std::vector<uintptr_t> getArrowArrayPtrs() { return {}; };
114+
virtual std::vector<uintptr_t> getArrowSchemaPtrs() { return {}; };
111115

112116
protected:
113117
/** list of all record batch in current chunk */

0 commit comments

Comments
 (0)