Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22237#discussion_r220908825
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/FailureSafeParser.scala
 ---
    @@ -15,50 +15,51 @@
      * limitations under the License.
      */
     
    -package org.apache.spark.sql.execution.datasources
    +package org.apache.spark.sql.catalyst.util
     
     import org.apache.spark.SparkException
     import org.apache.spark.sql.catalyst.InternalRow
     import org.apache.spark.sql.catalyst.expressions.GenericInternalRow
    -import org.apache.spark.sql.catalyst.util._
    -import org.apache.spark.sql.internal.SQLConf
    -import org.apache.spark.sql.types.StructType
    +import org.apache.spark.sql.types.{DataType, StructType}
     import org.apache.spark.unsafe.types.UTF8String
     
     class FailureSafeParser[IN](
         rawParser: IN => Seq[InternalRow],
         mode: ParseMode,
    -    schema: StructType,
    +    dataType: DataType,
         columnNameOfCorruptRecord: String,
         isMultiLine: Boolean) {
    -
    -  private val corruptFieldIndex = 
schema.getFieldIndex(columnNameOfCorruptRecord)
    -  private val actualSchema = StructType(schema.filterNot(_.name == 
columnNameOfCorruptRecord))
    -  private val resultRow = new GenericInternalRow(schema.length)
    -  private val nullResult = new GenericInternalRow(schema.length)
    -
       // This function takes 2 parameters: an optional partial result, and the 
bad record. If the given
       // schema doesn't contain a field for corrupted record, we just return 
the partial result or a
       // row with all fields null. If the given schema contains a field for 
corrupted record, we will
       // set the bad record to this field, and set other fields according to 
the partial result or null.
    -  private val toResultRow: (Option[InternalRow], () => UTF8String) => 
InternalRow = {
    --- End diff --
    
    Just to make the review easier, backporting easier, and keep the original 
author of the codes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to