zhaohaidao commented on code in PR #132:
URL: https://github.com/apache/fluss-rust/pull/132#discussion_r2678724304
##########
crates/fluss/src/client/table/scanner.rs:
##########
@@ -74,49 +74,11 @@ impl<'a> TableScan<'a> {
/// Returns an error if `column_indices` is empty or if any column index
is out of range.
///
/// # Example
- /// ```
- /// # use fluss::client::FlussConnection;
- /// # use fluss::config::Config;
- /// # use fluss::error::Result;
- /// # use fluss::metadata::{DataTypes, Schema, TableDescriptor, TablePath};
- /// # use fluss::row::InternalRow;
- /// # use std::time::Duration;
- ///
- /// # pub async fn example() -> Result<()> {
- /// let mut config = Config::default();
- /// config.bootstrap_server = Some("127.0.0.1:9123".to_string());
- /// let conn = FlussConnection::new(config).await?;
- ///
- /// let table_descriptor = TableDescriptor::builder()
- /// .schema(
- /// Schema::builder()
- /// .column("col1", DataTypes::int())
- /// .column("col2", DataTypes::string())
- /// .column("col3", DataTypes::string())
- /// .column("col3", DataTypes::string())
- /// .build()?,
- /// ).build()?;
- /// let table_path = TablePath::new("fluss".to_owned(),
"rust_test_long".to_owned());
- /// let admin = conn.get_admin().await?;
- /// admin.create_table(&table_path, &table_descriptor, true)
- /// .await?;
- /// let table_info = admin.get_table(&table_path).await?;
- /// let table = conn.get_table(&table_path).await?;
- ///
- /// // Project columns by indices
- /// let scanner = table.new_scan().project(&[0, 2,
3])?.create_log_scanner()?;
- /// let scan_records = scanner.poll(Duration::from_secs(10)).await?;
- /// for record in scan_records {
- /// let row = record.row();
- /// println!(
- /// "{{{}, {}, {}}}@{}",
- /// row.get_int(0),
- /// row.get_string(2),
- /// row.get_string(3),
- /// record.offset()
- /// );
- /// }
- /// # Ok(())
+ /// ```no_run
+ /// # fn example() -> fluss::error::Result<()> {
+ /// # let table: fluss::client::FlussTable<'_> = todo!("requires a Fluss
connection");
Review Comment:
fixed
--
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]