MCPcopy Create free account
hub / github.com/apache/datafusion / serialize_simple_select

Function serialize_simple_select

datafusion/substrait/tests/cases/serialize.rs:65–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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<()> {

Callers

nothing calls this directly

Calls 7

serializeFunction · 0.85
deserializeFunction · 0.85
from_substrait_planFunction · 0.85
sqlMethod · 0.80
into_optimized_planMethod · 0.80
create_contextFunction · 0.70
stateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…