Liyixin95 opened a new issue, #5304:
URL: https://github.com/apache/arrow-rs/issues/5304

   **Describe the bug**
   <!--
   A clear and concise description of what the bug is.
   -->
   
   **To Reproduce**
   <!--
   Steps to reproduce the behavior:
   -->
   
   first, create an empty parquet file using pandas 
   ```python
     import pandas as pd
   
     df = pd.DataFrame().reset_index(drop=True)
     df.to_parquet("./test.parquet")
   ```
   
   then, read this parquet using rust:
   ```rust
     let file = File::open("./test.parquet")?;
     let reader = SerializedFileReader::new(file)?;
   
     let iter = reader.get_row_iter(None)?;
     for record in iter {
         println!("{:?}", record);
     }
   ```
   
   and the program paniced:
   ```
   thread 'main' panicked at 
D:\env\rust\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\parquet-50.0.0\src\schema\types.rs:1088:78:
   called `Option::unwrap()` on a `None` value
   stack backtrace:
      0: std::panicking::begin_panic_handler
                at 
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\std\src\panicking.rs:645
      1: core::panicking::panic_fmt
                at 
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\core\src\panicking.rs:72
      2: core::panicking::panic
                at 
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\core\src\panicking.rs:127
      3: enum2$<core::option::Option<parquet::format::Type> 
>::unwrap<parquet::format::Type>
                at 
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\option.rs:931
      4: parquet::schema::types::from_thrift_helper
                at 
D:\env\rust\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\parquet-50.0.0\src\schema\types.rs:1088
      5: parquet::schema::types::from_thrift
                at 
D:\env\rust\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\parquet-50.0.0\src\schema\types.rs:1035
      6: parquet::file::footer::decode_metadata
                at 
D:\env\rust\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\parquet-50.0.0\src\file\footer.rs:74
      7: parquet::file::footer::parse_metadata<std::fs::File>
                at 
D:\env\rust\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\parquet-50.0.0\src\file\footer.rs:65
      8: 
parquet::file::serialized_reader::SerializedFileReader<std::fs::File>::new<std::fs::File>
                at 
D:\env\rust\.cargo\registry\src\rsproxy.cn-8f6827c7555bfaf8\parquet-50.0.0\src\file\serialized_reader.rs:182
      9: parquet_test::read_parquet_file<ref$<str$> >
                at .\src\main.rs:9
     10: parquet_test::main
                at .\src\main.rs:29
     11: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
                at 
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\ops\function.rs:250
     12: core::hint::black_box
                at 
/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\hint.rs:286
   note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 
backtrace.
   error: process didn't exit successfully: `target\debug\parquet_test.exe` 
(exit code: 101)
   ```
   
   **Expected behavior**
   <!--
   A clear and concise description of what you expected to happen.
   -->
   
   **Additional context**
   <!--
   Add any other context about the problem here.
   -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to