Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1486428: arrow per record timezone #1999

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -899,20 +899,29 @@ void CArrowTableIterator::convertTimestampTZColumn_nanoarrow(

ArrowArrayView* epochArray;
ArrowArrayView* fractionArray;
ArrowArrayView* timezoneArray;
for (int64_t i = 0; i < field->schema->n_children; i++) {
ArrowSchema* c_schema = field->schema->children[i];
if (std::strcmp(c_schema->name, internal::FIELD_NAME_EPOCH.c_str()) == 0) {
epochArray = columnArray->children[i];
} else if (std::strcmp(c_schema->name,
internal::FIELD_NAME_FRACTION.c_str()) == 0) {
fractionArray = columnArray->children[i];
} else if (std::strcmp(c_schema->name,
internal::FIELD_NAME_TIME_ZONE.c_str()) == 0) {
timezoneArray = columnArray->children[i];
} else {
// do nothing
}
}

for (int64_t rowIdx = 0; rowIdx < columnArray->array->length; rowIdx++) {
if (!ArrowArrayViewIsNull(columnArray, rowIdx)) {
// TODO:
// 1. is per record time offset supported?
// 2. if supported, how to append timezone info along with the UTC
// timestamp to the newArray
int32_t timezone = ArrowArrayViewGetIntUnsafe(timezoneArray, rowIdx);
if (byteLength == 8) {
int64_t epoch = ArrowArrayViewGetIntUnsafe(epochArray, rowIdx);
if (scale == 0) {
Expand Down
Loading