parquet_format_async_temp/lib.rs
1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements. See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership. The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License. You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied. See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18#![allow(dead_code)]
19#![allow(non_camel_case_types)]
20
21mod parquet_format;
22pub use crate::parquet_format::*;
23
24pub mod thrift;
25
26#[cfg(test)]
27mod tests {
28 use std::io::{Seek, SeekFrom};
29
30 use super::*;
31
32 #[test]
33 fn basic() {
34 let mut writer = std::io::Cursor::new(vec![]);
35 let mut protocol = thrift::protocol::TCompactOutputProtocol::new(&mut writer);
36 let metadata = FileMetaData {
37 version: 0,
38 schema: vec![],
39 num_rows: 0,
40 row_groups: vec![],
41 key_value_metadata: None,
42 created_by: None,
43 column_orders: None,
44 encryption_algorithm: None,
45 footer_signing_key_metadata: None,
46 };
47 metadata.write_to_out_protocol(&mut protocol).unwrap();
48
49 writer.seek(SeekFrom::Start(0)).unwrap();
50
51 let mut prot = thrift::protocol::TCompactInputProtocol::new(writer);
52 let result = FileMetaData::read_from_in_protocol(&mut prot).unwrap();
53 assert_eq!(result, metadata)
54 }
55}