From 09646589442dd9ad764d8fb0c899d5852bd4924e Mon Sep 17 00:00:00 2001 From: Chengcheng Jin Date: Sat, 20 Jul 2024 07:54:37 +0000 Subject: [PATCH] code style --- .../spark/sql/catalyst/expressions/ToStringUtil.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gluten-data/src/main/scala/org/apache/spark/sql/catalyst/expressions/ToStringUtil.scala b/gluten-data/src/main/scala/org/apache/spark/sql/catalyst/expressions/ToStringUtil.scala index f70d44c8349fe..77f71b763cef5 100644 --- a/gluten-data/src/main/scala/org/apache/spark/sql/catalyst/expressions/ToStringUtil.scala +++ b/gluten-data/src/main/scala/org/apache/spark/sql/catalyst/expressions/ToStringUtil.scala @@ -101,7 +101,6 @@ case class ToStringUtil(timeZoneId: Option[String] = None) val stringFunc = vectorToString(vec, colType) val castFunc = castToString(colType) for (i <- start until end) { - val str = if (vec.isNullAt(i)) "NULL" else castFunc(stringFunc(i)).toString @@ -124,14 +123,14 @@ case class ToStringUtil(timeZoneId: Option[String] = None) start: Int, length: Int, dataType: StructType, - truncate: Int = 20) = { + truncate: Int = 20): String = { rows .slice(start, start + length) .map(row => evalRow(row, dataType, truncate)) .mkString(System.lineSeparator()) } - def evalRow(row: InternalRow, dataType: StructType, truncate: Int = 20) = { + def evalRow(row: InternalRow, dataType: StructType, truncate: Int = 20): String = { dataType.zipWithIndex .map { case (colType, i) => @@ -145,7 +144,7 @@ case class ToStringUtil(timeZoneId: Option[String] = None) .mkString(" | ") } - override protected def doGenCode(ctx: CodegenContext, ev: ExprCode) = { + override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { throw new UnsupportedOperationException() }