You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/codegen/ExpressionCodegenSuite.scala
+52Lines changed: 52 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -134,6 +134,58 @@ class ExpressionCodegenSuite extends SparkFunSuite {
134
134
assert(inputRows(0) =="inputadaptor_row1")
135
135
}
136
136
137
+
test("Returns both input rows and variables for expression") {
138
+
valctx=newCodegenContext()
139
+
// 5 input variables in currentVars:
140
+
// 1 evaluated variable (value1).
141
+
// 3 not evaluated variables.
142
+
// value2 depends on an evaluated column from other operator.
143
+
// value3 depends on an input row from other operator.
144
+
// value4 depends on a not evaluated yet column from other operator.
145
+
// 1 null indicating to use input row "i".
146
+
valcurrentVars=Seq(
147
+
ExprCode("", isNull ="false", value ="value1"),
148
+
ExprCode("fake code;", isNull ="isNull2", value ="value2"),
149
+
ExprCode("fake code;", isNull ="isNull3", value ="value3"),
150
+
ExprCode("fake code;", isNull ="isNull4", value ="value4"),
151
+
null)
152
+
// value2 depends on this evaluated column.
153
+
currentVars(1).inputVars =Seq(ExprInputVar(ExprCode("", isNull ="isNull5", value ="value5"),
154
+
dataType =IntegerType, nullable =true))
155
+
// value3 depends on an input row "inputadaptor_row1".
156
+
currentVars(2).inputRow ="inputadaptor_row1"
157
+
// value4 depends on another not evaluated yet column.
0 commit comments