Skip to content

Commit 9647974

Browse files
committed
fix: add a regression test while I'm tooting around
Closes #2602 Signed-off-by: R. Tyler Croy <[email protected]>
1 parent f3d07c2 commit 9647974

File tree

1 file changed

+44
-0
lines changed
  • crates/core/src/delta_datafusion

1 file changed

+44
-0
lines changed

crates/core/src/delta_datafusion/mod.rs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,7 @@ mod tests {
858858
use datafusion_proto::physical_plan::AsExecutionPlan;
859859
use datafusion_proto::protobuf;
860860
use delta_kernel::path::{LogPathFileType, ParsedLogPath};
861+
use delta_kernel::schema::ArrayType;
861862
use futures::{stream::BoxStream, StreamExt};
862863
use object_store::ObjectMeta;
863864
use object_store::{
@@ -1850,6 +1851,49 @@ mod tests {
18501851
assert_eq!(expected, actual);
18511852
}
18521853

1854+
#[tokio::test]
1855+
async fn test_push_down_filter_panic_2602() -> DeltaResult<()> {
1856+
use crate::kernel::schema::{DataType, PrimitiveType};
1857+
let ctx = SessionContext::new();
1858+
let table = crate::DeltaOps::new_in_memory()
1859+
.create()
1860+
.with_column("id", DataType::Primitive(PrimitiveType::Long), true, None)
1861+
.with_column(
1862+
"name",
1863+
DataType::Primitive(PrimitiveType::String),
1864+
true,
1865+
None,
1866+
)
1867+
.with_column("b", DataType::Primitive(PrimitiveType::Boolean), true, None)
1868+
.with_column(
1869+
"ts",
1870+
DataType::Primitive(PrimitiveType::Timestamp),
1871+
true,
1872+
None,
1873+
)
1874+
.with_column("dt", DataType::Primitive(PrimitiveType::Date), true, None)
1875+
.with_column(
1876+
"zap",
1877+
DataType::Array(Box::new(ArrayType::new(
1878+
DataType::Primitive(PrimitiveType::Boolean),
1879+
true,
1880+
))),
1881+
true,
1882+
None,
1883+
)
1884+
.await?;
1885+
1886+
ctx.register_table("snapshot", Arc::new(table)).unwrap();
1887+
1888+
let df = ctx
1889+
.sql("select * from snapshot where id > 10000 and id < 20000")
1890+
.await
1891+
.unwrap();
1892+
1893+
let _ = df.collect().await?;
1894+
Ok(())
1895+
}
1896+
18531897
/// Records operations made by the inner object store on a channel obtained at construction
18541898
struct RecordingObjectStore {
18551899
inner: ObjectStoreRef,

0 commit comments

Comments
 (0)