use parquet::file::reader::{FileReader, SerializedFileReader};
use std::fs::File;

fn main() {
    let file_path = "/home/jgrusewski/Work/foxhunt/test_data/real/parquet/BTC-USD_30day_2024-09.parquet";
    let file = File::open(file_path).expect("Failed to open file");
    let reader = SerializedFileReader::new(file).expect("Failed to create reader");
    let parquet_metadata = reader.metadata();

    println!("Schema:");
    println!("{}", parquet_metadata.file_metadata().schema());

    println!("\nArrow Schema:");
    let arrow_schema = parquet::arrow::parquet_to_arrow_schema(
        parquet_metadata.file_metadata().schema_descr(),
        parquet_metadata.file_metadata().key_value_metadata()
    ).expect("Failed to convert schema");

    for field in arrow_schema.fields() {
        println!("  {}: {:?}", field.name(), field.data_type());
    }
}
