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

Function join_using_uppercase_column

datafusion/core/tests/sql/joins.rs:219–263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

217
218#[tokio::test]
219async fn join_using_uppercase_column() -> Result<()> {
220 let schema = Arc::new(Schema::new(vec![Field::new(
221 "UPPER",
222 DataType::UInt32,
223 false,
224 )]));
225 let tmp_dir = TempDir::new()?;
226 let file_path = tmp_dir.path().join("uppercase-column.csv");
227 let mut file = File::create(file_path.clone())?;
228 file.write_all("0".as_bytes())?;
229 drop(file);
230
231 let ctx = SessionContext::new();
232 ctx.register_csv(
233 "test",
234 file_path.to_str().unwrap(),
235 CsvReadOptions::new().schema(&schema).has_header(false),
236 )
237 .await?;
238
239 let dataframe = ctx
240 .sql(
241 r#"
242 SELECT test."UPPER" FROM "test"
243 INNER JOIN (
244 SELECT test."UPPER" FROM "test"
245 ) AS selection USING ("UPPER")
246 ;
247 "#,
248 )
249 .await?;
250
251 assert_batches_eq!(
252 [
253 "+-------+",
254 "| UPPER |",
255 "+-------+",
256 "| 0 |",
257 "+-------+",
258 ],
259 &dataframe.collect().await?
260 );
261
262 Ok(())
263}
264
265// Issue #17359: https://github.com/apache/datafusion/issues/17359
266#[tokio::test]

Callers

nothing calls this directly

Calls 10

newFunction · 0.85
createFunction · 0.85
sqlMethod · 0.80
joinMethod · 0.45
pathMethod · 0.45
cloneMethod · 0.45
write_allMethod · 0.45
register_csvMethod · 0.45
has_headerMethod · 0.45
schemaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…