Skip to content
Snippets Groups Projects
Commit 08c095b6 authored by Anand Avati's avatar Anand Avati Committed by Michael Armbrust
Browse files

[SPARK-1812] sql/catalyst - Provide explicit type information

For Scala 2.11 compatibility.

Without the explicit type specification, withNullability
return type is inferred to be Attribute, and thus calling
at() on the returned object fails in these tests:

[ERROR] /Users/avati/work/spark/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionEvaluationSuite.scala:370: value at is not a
[ERROR]     val c4_notNull = 'a.boolean.notNull.at(3)
[ERROR]                                         ^
[ERROR] /Users/avati/work/spark/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionEvaluationSuite.scala:371: value at is not a
[ERROR]     val c5_notNull = 'a.boolean.notNull.at(4)
[ERROR]                                         ^
[ERROR] /Users/avati/work/spark/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionEvaluationSuite.scala:372: value at is not a
[ERROR]     val c6_notNull = 'a.boolean.notNull.at(5)
[ERROR]                                         ^
[ERROR] /Users/avati/work/spark/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/ExpressionEvaluationSuite.scala:558: value at is not a
[ERROR]     val s_notNull = 'a.string.notNull.at(0)

Signed-off-by: Anand Avati <avatiredhat.com>

Author: Anand Avati <avati@redhat.com>

Closes #1709 from avati/SPARK-1812-notnull and squashes the following commits:

0470eb3 [Anand Avati] SPARK-1812: sql/catalyst - Provide explicit type information
parent 148af608
No related branches found
No related tags found
No related merge requests found
...@@ -134,7 +134,7 @@ case class AttributeReference(name: String, dataType: DataType, nullable: Boolea ...@@ -134,7 +134,7 @@ case class AttributeReference(name: String, dataType: DataType, nullable: Boolea
/** /**
* Returns a copy of this [[AttributeReference]] with changed nullability. * Returns a copy of this [[AttributeReference]] with changed nullability.
*/ */
override def withNullability(newNullability: Boolean) = { override def withNullability(newNullability: Boolean): AttributeReference = {
if (nullable == newNullability) { if (nullable == newNullability) {
this this
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment