()
| 467 | |
| 468 | #[test] |
| 469 | fn extract_string_column() { |
| 470 | let schema = test_schema(); |
| 471 | let decoder = TupleDecoder::new(&schema); |
| 472 | let rows = vec![ |
| 473 | vec![ |
| 474 | Value::Integer(1), |
| 475 | Value::String("hello".into()), |
| 476 | Value::Float(1.0), |
| 477 | Value::Bool(true), |
| 478 | ], |
| 479 | vec![ |
| 480 | Value::Integer(2), |
| 481 | Value::String("world".into()), |
| 482 | Value::Null, |
| 483 | Value::Null, |
| 484 | ], |
| 485 | ]; |
| 486 | let encoded = encode_rows(&schema, &rows); |
| 487 | let refs: Vec<&[u8]> = encoded.iter().map(|v| v.as_slice()).collect(); |
| 488 | |
| 489 | let arr = extract_column_to_arrow(&schema, &decoder, &refs, 1).unwrap(); |
| 490 | let str_arr = arr.as_any().downcast_ref::<StringArray>().unwrap(); |
| 491 | assert_eq!(str_arr.len(), 2); |
| 492 | assert_eq!(str_arr.value(0), "hello"); |
| 493 | assert_eq!(str_arr.value(1), "world"); |
| 494 | } |
| 495 | |
| 496 | #[test] |
| 497 | fn extract_bool_column_with_nulls() { |
nothing calls this directly
no test coverage detected