()
| 217 | |
| 218 | #[tokio::test] |
| 219 | async 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] |
nothing calls this directly
no test coverage detected
searching dependent graphs…