Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Won't Fix
-
2.4.0
-
None
-
None
Description
If we want to be consistent, we can modify the makeConverter function in UnivocityParser, but the performance may get worse.The modified code is as follows:
def makeConverter( name: String, dataType: DataType, nullable: Boolean = true, options: CSVOptions): ValueConverter = dataType match { case _: ByteType => (d: String) => nullSafeDatum(d, name, nullable, options)(_.toDouble.intValue().toByte) case _: ShortType => (d: String) => nullSafeDatum(d, name, nullable, options)(_.toDouble.intValue().toShort) case _: IntegerType => (d: String) => nullSafeDatum(d, name, nullable, options)(_.toDouble.intValue())