1515// specific language governing permissions and limitations
1616// under the License.
1717
18- use arrow:: array:: { Int64Builder , StringBuilder , UInt64Builder } ;
18+ use arrow:: array:: { StringBuilder , TimestampNanosecondBuilder , UInt64Builder } ;
1919use arrow:: record_batch:: RecordBatch ;
20- use arrow_schema:: { DataType , Field , Schema , SchemaRef } ;
20+ use arrow_schema:: { DataType , Field , Schema , SchemaRef , TimeUnit } ;
2121use async_trait:: async_trait;
2222use datafusion:: catalog:: SchemaProvider ;
2323use datafusion:: catalog:: { CatalogProvider , Session } ;
@@ -65,7 +65,11 @@ impl FileMetadata {
6565 Field :: new( "table_schema" , DataType :: Utf8 , false ) ,
6666 Field :: new( "table_name" , DataType :: Utf8 , false ) ,
6767 Field :: new( "file_path" , DataType :: Utf8 , false ) ,
68- Field :: new( "last_modified" , DataType :: Int64 , false ) ,
68+ Field :: new(
69+ "last_modified" ,
70+ DataType :: Timestamp ( TimeUnit :: Nanosecond , Some ( Arc :: from( "UTC" ) ) ) ,
71+ false ,
72+ ) ,
6973 Field :: new( "size" , DataType :: UInt64 , false ) ,
7074 ] ) ) ,
7175 catalog_list,
@@ -444,7 +448,7 @@ struct FileMetadataBuilder {
444448 schema_names : StringBuilder ,
445449 table_names : StringBuilder ,
446450 file_paths : StringBuilder ,
447- last_modified : Int64Builder ,
451+ last_modified : TimestampNanosecondBuilder ,
448452 size : UInt64Builder ,
449453}
450454
@@ -456,7 +460,7 @@ impl FileMetadataBuilder {
456460 schema_names : StringBuilder :: new ( ) ,
457461 table_names : StringBuilder :: new ( ) ,
458462 file_paths : StringBuilder :: new ( ) ,
459- last_modified : Int64Builder :: new ( ) ,
463+ last_modified : TimestampNanosecondBuilder :: new ( ) . with_timezone ( "UTC" ) ,
460464 size : UInt64Builder :: new ( ) ,
461465 }
462466 }
0 commit comments