/// Runs the specified `query` and returns the record batches of the result
Runs the specified `query` and returns the record batches of the result
Runs the specified ` query ` and returns the record batches of the result
async fn scrape_query(
    client: &mut influxdb_iox_client::flight::Client,
    db_name: &str,
    query: &str,
) -> Result<Vec<RecordBatch>> {
    let mut query_results = client
        .perform_query(ReadInfo {
            namespace_name: db_name.to_string(),
            sql_query: query.to_string(),
        })
        .await
        .context(RunningRemoteQuerySnafu)?;
    let mut batches = vec![];
    while let Some(data) = query_results
        .next()
        .await
        .context(RunningRemoteQuerySnafu)?
    {
        batches.push(data);
    }
    Ok(batches)
}
async fn scrape_query ( client : & mut influxdb_iox_client :: flight :: Client , db_name : & str , query : & str , ) -> Result < Vec < RecordBatch > > { let mut query_results = client . perform_query ( ReadInfo { namespace_name : db_name . to_string ( ) , sql_query : query . to_string ( ) , } ) . await . context ( RunningRemoteQuerySnafu ) ? ; let mut batches = vec ! [ ] ; while let Some ( data ) = query_results . next ( ) . await . context ( RunningRemoteQuerySnafu ) ? { batches . push ( data ) ; } Ok ( batches ) }
Runs the specified `query` and returns the record batches of the result
Runs the specified ` query ` and returns the record batches of the result
client
&mut influxdb_iox_client::flight::Client
db_name
&str
query
&str