Skip to content
Permalink
Browse files
[fix](spark connector) fix spark connector unsupport STRING type. (#2)
fix spark connector unsupported STRING type.
  • Loading branch information
Wahno authored and morningman-cmy committed Feb 11, 2022
1 parent 0923ced commit c5bf0b2fd31ff08ce1e819aabc85c744f77bb528
Showing 2 changed files with 2 additions and 0 deletions.
@@ -89,6 +89,7 @@ private[spark] object SchemaUtils {
case "VARCHAR" => DataTypes.StringType
case "DECIMALV2" => DecimalType(precision, scale)
case "TIME" => DataTypes.DoubleType
case "STRING" => DataTypes.StringType
case "HLL" =>
throw new DorisException("Unsupported type " + dorisType)
case _ =>
@@ -62,6 +62,7 @@ class TestSchemaUtils extends ExpectedExceptionTest {
Assert.assertEquals(DataTypes.StringType, SchemaUtils.getCatalystType("VARCHAR", 0, 0))
Assert.assertEquals(DecimalType(10, 5), SchemaUtils.getCatalystType("DECIMALV2", 10, 5))
Assert.assertEquals(DataTypes.DoubleType, SchemaUtils.getCatalystType("TIME", 0, 0))
Assert.assertEquals(DataTypes.StringType, SchemaUtils.getCatalystType("STRING", 0, 0))

thrown.expect(classOf[DorisException])
thrown.expectMessage(startsWith("Unsupported type"))

0 comments on commit c5bf0b2

Please sign in to comment.