@@ -77,12 +77,12 @@ trait CaseConversionExpression {
7777
7878 def convert (v : String ): String
7979
80- def nullable : Boolean = true
80+ def nullable : Boolean = child.nullable
8181 def dataType : DataType = StringType
8282
8383 override def eval (input : Row ): Any = {
84- val beConverted = child.eval(input)
85- convert(beConverted .toString)
84+ val converted = child.eval(input)
85+ convert(converted .toString)
8686 }
8787}
8888
@@ -124,7 +124,7 @@ case class Like(left: Expression, right: Expression)
124124 override def matches (regex : Pattern , str : String ): Boolean = regex.matcher(str).matches()
125125}
126126
127- case class RLike (left : Expression , right : Expression )
127+ case class RLike (left : Expression , right : Expression )
128128 extends BinaryExpression with StringRegexExpression {
129129
130130 def symbol = " RLIKE"
@@ -133,19 +133,17 @@ case class RLike(left: Expression, right: Expression)
133133}
134134
135135/**
136- * System function upper()
137- * */
138- case class Upper (child : Expression )
139- extends UnaryExpression with CaseConversionExpression {
136+ * A function that converts the characters of a string to uppercase.
137+ */
138+ case class Upper (child : Expression ) extends UnaryExpression with CaseConversionExpression {
140139
141- override def convert (v : String ): String = { v.toUpperCase()}
140+ override def convert (v : String ): String = v.toUpperCase()
142141}
143142
144143/**
145- * System function lower()
146- * */
147- case class Lower (child : Expression )
148- extends UnaryExpression with CaseConversionExpression {
144+ * A function that converts the characters of a string to lowercase.
145+ */
146+ case class Lower (child : Expression ) extends UnaryExpression with CaseConversionExpression {
149147
150- override def convert (v : String ): String = { v.toLowerCase()}
151- }
148+ override def convert (v : String ): String = v.toLowerCase()
149+ }
0 commit comments