Skip to content

Commit c53867f

Browse files
committed
fix exprapi test
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
1 parent ebda09c commit c53867f

File tree

1 file changed

+4
-10
lines changed
  • datafusion/core/tests/expr_api

1 file changed

+4
-10
lines changed

datafusion/core/tests/expr_api/mod.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ fn test_eq_with_coercion() {
6060

6161
#[test]
6262
fn test_get_field() {
63-
// field access Expr::field() requires a rewrite to work
6463
evaluate_expr_test(
65-
col("props").field("a"),
64+
get_field(col("props"), lit("a")),
6665
vec![
6766
"+------------+",
6867
"| expr |",
@@ -77,11 +76,8 @@ fn test_get_field() {
7776

7877
#[test]
7978
fn test_nested_get_field() {
80-
// field access Expr::field() requires a rewrite to work, test when it is
81-
// not the root expression
8279
evaluate_expr_test(
83-
col("props")
84-
.field("a")
80+
get_field(col("props"), lit("a"))
8581
.eq(lit("2021-02-02"))
8682
.or(col("id").eq(lit(1))),
8783
vec![
@@ -98,9 +94,8 @@ fn test_nested_get_field() {
9894

9995
#[test]
10096
fn test_list() {
101-
// list access also requires a rewrite to work
10297
evaluate_expr_test(
103-
col("list").index(lit(1i64)),
98+
array_element(col("list"), lit(1i64)),
10499
vec![
105100
"+------+", "| expr |", "+------+", "| one |", "| two |", "| five |",
106101
"+------+",
@@ -110,9 +105,8 @@ fn test_list() {
110105

111106
#[test]
112107
fn test_list_range() {
113-
// range access also requires a rewrite to work
114108
evaluate_expr_test(
115-
col("list").range(lit(1i64), lit(2i64)),
109+
array_slice(col("list"), lit(1i64), lit(2i64), lit(1i64)),
116110
vec![
117111
"+--------------+",
118112
"| expr |",

0 commit comments

Comments
 (0)