Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/12364#discussion_r62167521
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects.scala
---
@@ -688,3 +688,38 @@ case class AssertNotNull(child: Expression,
walkedTypePath: Seq[String])
ev.copy(code = code, isNull = "false", value = childGen.value)
}
}
+
+/**
+ * Returns the value of field at index `index` from the external row
`child`.
+ *
+ * Note that the input row and the field we try to get are both guaranteed
to be not null, if they
+ * are null, a runtime exception will be thrown.
+ */
+case class GetExternalRowField(
+ child: Expression,
+ index: Int,
+ dataType: DataType) extends UnaryExpression with NonSQLExpression {
+
+ override def nullable: Boolean = false
+
+ override def eval(input: InternalRow): Any =
+ throw new UnsupportedOperationException("Only code-generated
evaluation is supported")
--- End diff --
Not related to this PR. We might want to add a `CodegenOnly` trait
extending from `Expression` to avoid duplicating this one.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]