()
| 63 | |
| 64 | #[tokio::test] |
| 65 | async fn serialize_simple_select() -> Result<()> { |
| 66 | let ctx = create_context().await?; |
| 67 | let path = "tests/simple_select.bin"; |
| 68 | let sql = "SELECT a, b FROM data"; |
| 69 | // Test reference |
| 70 | let df_ref = ctx.sql(sql).await?; |
| 71 | let plan_ref = df_ref.into_optimized_plan()?; |
| 72 | // Test |
| 73 | // Write substrait plan to file |
| 74 | serializer::serialize(sql, &ctx, path).await?; |
| 75 | // Read substrait plan from file |
| 76 | let proto = serializer::deserialize(path).await?; |
| 77 | // Check plan equality |
| 78 | let plan = from_substrait_plan(&ctx.state(), &proto).await?; |
| 79 | let plan_str_ref = format!("{plan_ref}"); |
| 80 | let plan_str = format!("{plan}"); |
| 81 | assert_eq!(plan_str_ref, plan_str); |
| 82 | // Delete test binary file |
| 83 | fs::remove_file(path)?; |
| 84 | |
| 85 | Ok(()) |
| 86 | } |
| 87 | |
| 88 | #[tokio::test] |
| 89 | async fn table_scan_without_projection() -> Result<()> { |
nothing calls this directly
no test coverage detected
searching dependent graphs…