pub fn to_parquet_file(
        &self,
        partition_id: PartitionId,
        file_size_bytes: usize,
        metadata: &IoxParquetMetaData,
    ) -> ParquetFileParams {
        let decoded = metadata.decode().expect("invalid IOx metadata");
        trace!(
            ?partition_id,
            ?decoded,
            "DecodedIoxParquetMetaData decoded from its IoxParquetMetaData"
        );
        let row_count = decoded.row_count();
        if decoded.md.row_groups().is_empty() {
            debug!(
                ?partition_id,
                "Decoded IoxParquetMetaData has no row groups to provide useful statistics"
            );
        }

        // Derive the min/max timestamp from the Parquet column statistics.
        let schema = decoded
            .read_schema()
            .expect("failed to read encoded schema");
        let time_summary = decoded
            .read_statistics(&*schema)
            .expect("invalid statistics")
            .into_iter()
            .find(|v| v.name == TIME_COLUMN_NAME)
            .expect("no time column in metadata statistics");

        // Sanity check the type of this column before using the values.
        assert_eq!(time_summary.influxdb_type, Some(InfluxDbType::Timestamp));

        // Extract the min/max timestamps.
        let (min_time, max_time) = match time_summary.stats {
            Statistics::I64(stats) => {
                let min = Timestamp::new(stats.min.expect("no min time statistic"));
                let max = Timestamp::new(stats.max.expect("no max time statistic"));
                (min, max)
            }
            _ => panic!("unexpected physical type for timestamp column"),
        };

        ParquetFileParams {
            sequencer_id: self.sequencer_id,
            namespace_id: self.namespace_id,
            table_id: self.table_id,
            partition_id: self.partition_id,
            object_store_id: self.object_store_id,
            min_sequence_number: self.min_sequence_number,
            max_sequence_number: self.max_sequence_number,
            min_time,
            max_time,
            file_size_bytes: file_size_bytes as i64,
            parquet_metadata: metadata.thrift_bytes().to_vec(),
            compaction_level: self.compaction_level,
            row_count: row_count.try_into().expect("row count overflows i64"),
            created_at: Timestamp::new(self.creation_timestamp.timestamp_nanos()),
        }
    }
/// Create a corresponding iox catalog's ParquetFile
///
/// # Panics
///
/// This method panics if the [`IoxParquetMetaData`] structure does not
/// contain valid metadata bytes, has no readable schema, or has no field
/// statistics.
///
/// A [`RecordBatch`] serialized without the embedded metadata found in the
/// IOx [`Schema`] type will cause a statistic resolution failure due to
/// lack of the IOx field type metadata for the time column. Batches
/// produced from the through the IOx write path always include this
/// metadata.
///
/// [`RecordBatch`]: arrow::record_batch::RecordBatch
Create a corresponding iox catalog's ParquetFile
Create a corresponding iox catalog ' s ParquetFile
pub fn to_parquet_file(
        &self,
        partition_id: PartitionId,
        file_size_bytes: usize,
        metadata: &IoxParquetMetaData,
    ) -> ParquetFileParams {
        let decoded = metadata.decode().expect("invalid IOx metadata");
        trace!(
            ?partition_id,
            ?decoded,
            "DecodedIoxParquetMetaData decoded from its IoxParquetMetaData"
        );
        let row_count = decoded.row_count();
        if decoded.md.row_groups().is_empty() {
            debug!(
                ?partition_id,
                "Decoded IoxParquetMetaData has no row groups to provide useful statistics"
            );
        }
        // Derive the min/max timestamp from the Parquet column statistics.
        let schema = decoded
            .read_schema()
            .expect("failed to read encoded schema");
        let time_summary = decoded
            .read_statistics(&*schema)
            .expect("invalid statistics")
            .into_iter()
            .find(|v| v.name == TIME_COLUMN_NAME)
            .expect("no time column in metadata statistics");
        // Sanity check the type of this column before using the values.
        assert_eq!(time_summary.influxdb_type, Some(InfluxDbType::Timestamp));
        // Extract the min/max timestamps.
        let (min_time, max_time) = match time_summary.stats {
            Statistics::I64(stats) => {
                let min = Timestamp::new(stats.min.expect("no min time statistic"));
                let max = Timestamp::new(stats.max.expect("no max time statistic"));
                (min, max)
            }
            _ => panic!("unexpected physical type for timestamp column"),
        };
        ParquetFileParams {
            sequencer_id: self.sequencer_id,
            namespace_id: self.namespace_id,
            table_id: self.table_id,
            partition_id: self.partition_id,
            object_store_id: self.object_store_id,
            min_sequence_number: self.min_sequence_number,
            max_sequence_number: self.max_sequence_number,
            min_time,
            max_time,
            file_size_bytes: file_size_bytes as i64,
            parquet_metadata: metadata.thrift_bytes().to_vec(),
            compaction_level: self.compaction_level,
            row_count: row_count.try_into().expect("row count overflows i64"),
            created_at: Timestamp::new(self.creation_timestamp.timestamp_nanos()),
        }
    }
pub fn to_parquet_file ( & self , partition_id : PartitionId , file_size_bytes : usize , metadata : & IoxParquetMetaData , ) -> ParquetFileParams { let decoded = metadata . decode ( ) . expect ( " " ) ; trace ! ( partition_id decoded " " ) ; let row_count = decoded . row_count ( ) ; if decoded . md . row_groups ( ) . is_empty ( ) { debug ! ( partition_id " " ) ; } // Derive the min/max timestamp from the Parquet column statistics. let schema = decoded . read_schema ( ) . expect ( " " ) ; let time_summary = decoded . read_statistics ( & * schema ) . expect ( " " ) . into_iter ( ) . find ( | v | v . name == TIME_COLUMN_NAME ) . expect ( " " ) ; // Sanity check the type of this column before using the values. assert_eq ! ( time_summary influxdb_type Some ( InfluxDbType Timestamp ) ) ; // Extract the min/max timestamps. let ( min_time , max_time ) = match time_summary . stats { Statistics :: I64 ( stats ) => { let min = Timestamp :: new ( stats . min . expect ( " " ) ) ; let max = Timestamp :: new ( stats . max . expect ( " " ) ) ; ( min , max ) } _ => panic ! ( " " ) , } ; ParquetFileParams { sequencer_id : self . sequencer_id , namespace_id : self . namespace_id , table_id : self . table_id , partition_id : self . partition_id , object_store_id : self . object_store_id , min_sequence_number : self . min_sequence_number , max_sequence_number : self . max_sequence_number , min_time , max_time , file_size_bytes : file_size_bytes as i64 , parquet_metadata : metadata . thrift_bytes ( ) . to_vec ( ) , compaction_level : self . compaction_level , row_count : row_count . try_into ( ) . expect ( " " ) , created_at : Timestamp :: new ( self . creation_timestamp . timestamp_nanos ( ) ) , } }
Create a corresponding iox catalog's ParquetFile
Create a corresponding iox catalog ' s ParquetFile
&self
partition_id
PartitionId
file_size_bytes
usize
metadata
&IoxParquetMetaData
&self
partition_id
PartitionId
file_size_bytes
usize
metadata
&IoxParquetMetaData
panics
This method panics if the [`IoxParquetMetaData`] structure does not
contain valid metadata bytes, has no readable schema, or has no field
statistics.

A [`RecordBatch`] serialized without the embedded metadata found in the
IOx [`Schema`] type will cause a statistic resolution failure due to
lack of the IOx field type metadata for the time column. Batches
produced from the through the IOx write path always include this
metadata.

[`RecordBatch`]: arrow::record_batch::RecordBatch
This method panics if the [ ` IoxParquetMetaData ` ] structure does not contain valid metadata bytes has no readable schema or has no field statistics . A [ ` RecordBatch ` ] serialized without the embedded metadata found in the IOx [ ` Schema ` ] type will cause a statistic resolution failure due to lack of the IOx field type metadata for the time column . Batches produced from the through the IOx write path always include this metadata . [ ` RecordBatch ` ] : arrow :: record_batch :: RecordBatch