Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchengchenghh committed Jul 20, 2024
1 parent 30fe1a5 commit 0964658
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) =>
Expand All @@ -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()
}

Expand Down

0 comments on commit 0964658

Please sign in to comment.