async fn load_partition(
    catalog: &Arc<dyn Catalog>,
    schema: &CatalogNamespaceSchema,
    table_name: &str,
    remote_partition: &Partition,
) -> Result<PartitionMapping, Error> {
    let mut repos = catalog.repositories().await;
    let topic = repos
        .kafka_topics()
        .get_by_name(KAFKA_NAME)
        .await?
        .expect("topic should have been inserted earlier");
    let sequencer = repos
        .sequencers()
        .get_by_topic_id_and_partition(topic.id, KafkaPartition::new(KAFKA_PARTITION))
        .await?
        .expect("sequencer should have been inserted earlier");
    let table = schema
        .tables
        .get(table_name)
        .expect("table should have been loaded");
    let partition = repos
        .partitions()
        .create_or_get(&remote_partition.key, sequencer.id, table.id)
        .await?;

    Ok(PartitionMapping {
        sequencer_id: sequencer.id,
        table_id: table.id,
        partition_id: partition.id,
        remote_partition_id: remote_partition.id,
    })
}
// this function will get the table from the schema and insert a record in the catalog for the
// partition and return the mapping information that can be used to get parquet file records and
// the files.
this function will get the table from the schema and insert a record in the catalog for the
partition and return the mapping information that can be used to get parquet file records and
the files.
this function will get the table from the schema and insert a record in the catalog for the partition and return the mapping information that can be used to get parquet file records and the files .
async fn load_partition(
    catalog: &Arc<dyn Catalog>,
    schema: &CatalogNamespaceSchema,
    table_name: &str,
    remote_partition: &Partition,
) -> Result<PartitionMapping, Error> {
    let mut repos = catalog.repositories().await;
    let topic = repos
        .kafka_topics()
        .get_by_name(KAFKA_NAME)
        .await?
        .expect("topic should have been inserted earlier");
    let sequencer = repos
        .sequencers()
        .get_by_topic_id_and_partition(topic.id, KafkaPartition::new(KAFKA_PARTITION))
        .await?
        .expect("sequencer should have been inserted earlier");
    let table = schema
        .tables
        .get(table_name)
        .expect("table should have been loaded");
    let partition = repos
        .partitions()
        .create_or_get(&remote_partition.key, sequencer.id, table.id)
        .await?;
    Ok(PartitionMapping {
        sequencer_id: sequencer.id,
        table_id: table.id,
        partition_id: partition.id,
        remote_partition_id: remote_partition.id,
    })
}
async fn load_partition ( catalog : & Arc < dyn Catalog > , schema : & CatalogNamespaceSchema , table_name : & str , remote_partition : & Partition , ) -> Result < PartitionMapping , Error > { let mut repos = catalog . repositories ( ) . await ; let topic = repos . kafka_topics ( ) . get_by_name ( KAFKA_NAME ) . await ? . expect ( " " ) ; let sequencer = repos . sequencers ( ) . get_by_topic_id_and_partition ( topic . id , KafkaPartition :: new ( KAFKA_PARTITION ) ) . await ? . expect ( " " ) ; let table = schema . tables . get ( table_name ) . expect ( " " ) ; let partition = repos . partitions ( ) . create_or_get ( & remote_partition . key , sequencer . id , table . id ) . await ? ; Ok ( PartitionMapping { sequencer_id : sequencer . id , table_id : table . id , partition_id : partition . id , remote_partition_id : remote_partition . id , } ) }
this function will get the table from the schema and insert a record in the catalog for the
partition and return the mapping information that can be used to get parquet file records and
the files.
this function will get the table from the schema and insert a record in the catalog for the partition and return the mapping information that can be used to get parquet file records and the files .
catalog
&Arc<dyn Catalog>
schema
&CatalogNamespaceSchema
table_name
&str
remote_partition
&Partition
catalog
&Arc<dyn Catalog>
schema
&CatalogNamespaceSchema
table_name
&str
remote_partition
&Partition