discivigour commented on code in PR #160:
URL: https://github.com/apache/paimon-rust/pull/160#discussion_r3016241277


##########
crates/integration_tests/tests/read_tables.rs:
##########
@@ -438,3 +445,169 @@ async fn test_read_projection_duplicate_column() {
         "Expected ConfigInvalid for duplicate projection, got: {err:?}"
     );
 }
+
+// ======================= REST Catalog read tests 
===============================
+
+/// Build a simple test schema matching the Spark-provisioned tables (id INT, 
name VARCHAR).
+fn simple_log_schema() -> Schema {
+    Schema::builder()
+        .column("id", DataType::Int(IntType::new()))
+        .column("name", DataType::VarChar(VarCharType::string_type()))
+        .build()
+        .expect("Failed to build schema")
+}
+
+/// Build a DV-enabled primary key schema (id INT NOT NULL as PK, name 
VARCHAR).
+fn simple_dv_pk_schema() -> Schema {
+    Schema::builder()
+        .column("id", DataType::Int(IntType::with_nullable(false)))
+        .column("name", DataType::VarChar(VarCharType::string_type()))
+        .primary_key(["id"])
+        .option("deletion-vectors.enabled", "true")
+        .build()
+        .expect("Failed to build schema")
+}
+
+/// Start a mock REST server backed by Spark-provisioned data on disk,
+/// register the given tables, and return a connected `RESTCatalog`.
+async fn setup_rest_catalog_with_tables(
+    table_configs: &[(&str, &str, Schema)],
+) -> (mock_server::RESTServer, RESTCatalog) {
+    let catalog_path = get_test_warehouse();
+    // Use a simple warehouse name (no slashes) to avoid URL-encoding issues
+    let warehouse_name = "test_warehouse";
+    let prefix = "mock-test";
+    let mut defaults = HashMap::new();
+    defaults.insert("prefix".to_string(), prefix.to_string());
+    let config = ConfigResponse::new(defaults);
+
+    let server = start_mock_server(
+        warehouse_name.to_string(),
+        catalog_path.clone(),
+        config,
+        vec!["default".to_string()],
+    )
+    .await;
+
+    // Register each table with its schema and the real on-disk path
+    for (database, table_name, schema) in table_configs {
+        let table_path = format!("{}/{}.db/{}", catalog_path, database, 
table_name);
+        server.add_table_with_schema(database, table_name, schema.clone(), 
&table_path);
+    }
+
+    let url = server.url().expect("Failed to get server URL");
+    let mut options = Options::new();
+    options.set("uri", &url);
+    options.set("warehouse", warehouse_name);
+    options.set("token.provider", "bear");
+    options.set("token", "test_token");
+
+    let catalog = RESTCatalog::new(options, true)
+        .await
+        .expect("Failed to create RESTCatalog");
+
+    (server, catalog)
+}
+
+/// Test reading an append-only (log) table via REST catalog backed by mock 
server.
+///
+/// The mock server returns table metadata pointing to Spark-provisioned data 
on disk.
+#[tokio::test]
+async fn test_rest_catalog_read_append_table() {

Review Comment:
   Got it.



-- 
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]

Reply via email to