Skip to content

Commit

Permalink
return timestamp with timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxxen committed Nov 20, 2024
1 parent c29c67b commit ac5903d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/function/table/read_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static unique_ptr<FunctionData> ReadFileBind(ClientContext &context, TableFuncti
names.push_back("content");
return_types.push_back(LogicalType::BIGINT);
names.push_back("size");
return_types.push_back(LogicalType::TIMESTAMP);
return_types.push_back(LogicalType::TIMESTAMP_TZ);
names.push_back("last_modified");

return std::move(result);
Expand Down Expand Up @@ -172,7 +172,8 @@ static void ReadFileExecute(ClientContext &context, TableFunctionInput &input, D
// correctly)
try {
auto timestamp_seconds = Timestamp::FromEpochSeconds(fs.GetLastModifiedTime(*file_handle));
FlatVector::GetData<timestamp_t>(last_modified_vector)[out_idx] = timestamp_seconds;
FlatVector::GetData<timestamp_tz_t>(last_modified_vector)[out_idx] =
timestamp_tz_t(timestamp_seconds);
} catch (std::exception &ex) {
ErrorData error(ex);
if (error.Type() == ExceptionType::CONVERSION) {
Expand Down

0 comments on commit ac5903d

Please sign in to comment.