jackylk commented on a change in pull request #3538: [CARBONDATA-3637] Optimize insert into flow URL: https://github.com/apache/carbondata/pull/3538#discussion_r376196613
########## File path: integration/spark2/src/main/scala/org/apache/spark/sql/execution/datasources/SparkCarbonTableFormat.scala ########## @@ -509,30 +514,17 @@ private class CarbonOutputWriter(path: String, // TODO Implement writesupport interface to support writing Row directly to recordwriter def writeCarbon(row: InternalRow): Unit = { - val data = new Array[AnyRef](fieldTypes.length + partitionData.length) - var i = 0 - val fieldTypesLen = fieldTypes.length - while (i < fieldTypesLen) { - if (!row.isNullAt(i)) { - fieldTypes(i) match { - case StringType => - data(i) = row.getString(i) - case d: DecimalType => - data(i) = row.getDecimal(i, d.precision, d.scale).toJavaBigDecimal - case other => - data(i) = row.get(i, other) - } - } - i += 1 - } + val totalLength = fieldTypes.length + partitionData.length Review comment: Is this number of columns? suggest to change to `numColumns` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services