1
0

[HUDI-622]: Remove VisibleForTesting annotation and import from code (#1343)

* HUDI:622: Remove VisibleForTesting annotation and import from code
This commit is contained in:
Suneel Marthi
2020-02-20 02:17:53 -05:00
committed by GitHub
parent c2b08cdfc9
commit f9d2f66dc1
18 changed files with 6 additions and 49 deletions

View File

@@ -127,7 +127,7 @@ object AvroConversionHelper {
new Timestamp(item.asInstanceOf[Long])
case other =>
throw new IncompatibleSchemaException(
s"Cannot convert Avro logical type ${other} to Catalyst Timestamp type.")
s"Cannot convert Avro logical type $other to Catalyst Timestamp type.")
}
}
case (struct: StructType, RECORD) =>
@@ -215,7 +215,7 @@ object AvroConversionHelper {
createConverter(Schema.createUnion(remainingUnionTypes.asJava), sqlType, path)
}
} else avroSchema.getTypes.asScala.map(_.getType) match {
case Seq(t1) => createConverter(avroSchema.getTypes.get(0), sqlType, path)
case Seq(_) => createConverter(avroSchema.getTypes.get(0), sqlType, path)
case Seq(a, b) if Set(a, b) == Set(INT, LONG) && sqlType == LongType =>
(item: AnyRef) => {
item match {
@@ -286,7 +286,7 @@ object AvroConversionHelper {
case ShortType => (item: Any) =>
if (item == null) null else item.asInstanceOf[Short].intValue
case dec: DecimalType => (item: Any) =>
Option(item).map { i =>
Option(item).map { _ =>
val bigDecimalValue = item.asInstanceOf[java.math.BigDecimal]
val decimalConversions = new DecimalConversion()
decimalConversions.toFixed(bigDecimalValue, avroSchema.getField(structName).schema().getTypes.get(0),