()
| 177 | |
| 178 | #[wasm_bindgen_test(unsupported = tokio::test)] |
| 179 | async fn test_basic_aggregate() { |
| 180 | let sql = |
| 181 | "SELECT FIRST_VALUE(value) OVER (ORDER BY id) as first_val FROM test_table;"; |
| 182 | |
| 183 | let schema = Arc::new(Schema::new(vec![ |
| 184 | Field::new("id", DataType::Int32, false), |
| 185 | Field::new("value", DataType::Utf8, false), |
| 186 | ])); |
| 187 | |
| 188 | let data: Vec<ArrayRef> = vec![ |
| 189 | Arc::new(Int32Array::from(vec![1])), |
| 190 | Arc::new(StringArray::from(vec!["a"])), |
| 191 | ]; |
| 192 | |
| 193 | let batch = RecordBatch::try_new(schema.clone(), data).unwrap(); |
| 194 | let table = MemTable::try_new(schema.clone(), vec![vec![batch]]).unwrap(); |
| 195 | |
| 196 | let ctx = get_ctx(); |
| 197 | ctx.register_table("test_table", Arc::new(table)).unwrap(); |
| 198 | |
| 199 | let statement = DFParser::parse_sql(sql).unwrap().pop_back().unwrap(); |
| 200 | |
| 201 | let logical_plan = ctx.state().statement_to_plan(statement).await.unwrap(); |
| 202 | let data_frame = ctx.execute_logical_plan(logical_plan).await.unwrap(); |
| 203 | let physical_plan = data_frame.create_physical_plan().await.unwrap(); |
| 204 | |
| 205 | let task_ctx = ctx.task_ctx(); |
| 206 | let _ = collect(physical_plan, task_ctx).await.unwrap(); |
| 207 | } |
| 208 | |
| 209 | #[wasm_bindgen_test(unsupported = tokio::test)] |
| 210 | async fn test_parquet_write() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…