Skip to content

Commit

Permalink
adjust + fuse types tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dshaaban01 committed Jan 9, 2025
1 parent 99d18f0 commit 296155a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 58 deletions.
14 changes: 14 additions & 0 deletions test/Dialect/Substrait/types.mlir
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
// RUN: substrait-opt -split-input-file %s \
// RUN: | FileCheck %s

// CHECK-LABEL: substrait.plan
// CHECK: relation
// CHECK: %[[V0:.*]] = named_table @t1 as ["a", "b"] : tuple<!substrait.interval_year, !substrait.interval_day>
// CHECK-NEXT: yield %0 : tuple<!substrait.interval_year, !substrait.interval_day>

substrait.plan version 0 : 42 : 1 {
relation {
%0 = named_table @t1 as ["a", "b"] : tuple<!substrait.interval_year, !substrait.interval_day>
yield %0 : tuple<!substrait.interval_year, !substrait.interval_day>
}
}

// -----

// CHECK-LABEL: substrait.plan
// CHECK: relation
// CHECK: %[[V0:.*]] = named_table @t1 as ["a", "b"] : tuple<f32, f64>
Expand Down
29 changes: 5 additions & 24 deletions test/Target/SubstraitPB/Export/types.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,15 @@
// CHECK-NEXT: read {
// CHECK: base_schema {
// CHECK-NEXT: names: "a"
// CHECK-NEXT: names: "b"
// CHECK-NEXT: struct {
// CHECK-NEXT: types {
// CHECK-NEXT: interval_day {
// CHECK-NEXT: interval_year {
// CHECK-NEXT: nullability: NULLABILITY_REQUIRED
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: nullability: NULLABILITY_REQUIRED
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: named_table {

substrait.plan version 0 : 42 : 1 {
relation {
%0 = named_table @t1 as ["a"] : tuple<!substrait.interval_day>
yield %0 : tuple<!substrait.interval_day>
}
}

// -----

// CHECK-LABEL: relations {
// CHECK-NEXT: rel {
// CHECK-NEXT: read {
// CHECK: base_schema {
// CHECK-NEXT: names: "a"
// CHECK-NEXT: struct {
// CHECK-NEXT: types {
// CHECK-NEXT: interval_year {
// CHECK-NEXT: interval_day {
// CHECK-NEXT: nullability: NULLABILITY_REQUIRED
// CHECK-NEXT: }
// CHECK-NEXT: }
Expand All @@ -52,8 +33,8 @@ substrait.plan version 0 : 42 : 1 {

substrait.plan version 0 : 42 : 1 {
relation {
%0 = named_table @t1 as ["a"] : tuple<!substrait.interval_year>
yield %0 : tuple<!substrait.interval_year>
%0 = named_table @t1 as ["a", "b"] : tuple<!substrait.interval_year, !substrait.interval_day>
yield %0 : tuple<!substrait.interval_year, !substrait.interval_day>
}
}

Expand Down
38 changes: 4 additions & 34 deletions test/Target/SubstraitPB/Import/types.textpb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# CHECK: substrait.plan
# CHECK-NEXT: relation
# CHECK-NEXT: named_table
# CHECK-SAME: : tuple<!substrait.interval_day>
# CHECK-SAME: : tuple<!substrait.interval_year, !substrait.interval_day>

relations {
rel {
Expand All @@ -24,45 +24,15 @@ relations {
}
base_schema {
names: "a"
names: "b"
struct {
types {
interval_day {
interval_year {
nullability: NULLABILITY_REQUIRED
}
}
nullability: NULLABILITY_REQUIRED
}
}
named_table {
names: "t1"
}
}
}
}
version {
minor_number: 42
patch_number: 1
}

# -----

# CHECK: substrait.plan
# CHECK-NEXT: relation
# CHECK-NEXT: named_table
# CHECK-SAME: : tuple<!substrait.interval_year>

relations {
rel {
read {
common {
direct {
}
}
base_schema {
names: "a"
struct {
types {
interval_year {
interval_day {
nullability: NULLABILITY_REQUIRED
}
}
Expand Down

0 comments on commit 296155a

Please sign in to comment.