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

Function test_list_query_parameters

datafusion/core/tests/sql/select.rs:25–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24#[tokio::test]
25async fn test_list_query_parameters() -> Result<()> {
26 let tmp_dir = TempDir::new()?;
27 let partition_count = 4;
28 let ctx = create_ctx_with_partition(&tmp_dir, partition_count).await?;
29
30 let results = ctx
31 .sql("SELECT * FROM test WHERE c1 = $1")
32 .await?
33 .with_param_values(vec![ScalarValue::from(3i32)])?
34 .collect()
35 .await?;
36 assert_snapshot!(batches_to_sort_string(&results), @r"
37 +----+----+-------+
38 | c1 | c2 | c3 |
39 +----+----+-------+
40 | 3 | 1 | false |
41 | 3 | 10 | true |
42 | 3 | 2 | true |
43 | 3 | 3 | false |
44 | 3 | 4 | true |
45 | 3 | 5 | false |
46 | 3 | 6 | true |
47 | 3 | 7 | false |
48 | 3 | 8 | true |
49 | 3 | 9 | false |
50 +----+----+-------+
51 ");
52 Ok(())
53}
54
55#[tokio::test]
56async fn test_named_query_parameters() -> Result<()> {

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
collectMethod · 0.80
sqlMethod · 0.80
with_param_valuesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…