in connectors/spark-iotdb-table-connector/spark-iotdb-table-common/src/main/scala/org/apache/iotdb/spark/table/db/IoTDBUtils.scala [117:138]
def getIoTDBDataType(sparkDataType: DataType): TSDataType = {
sparkDataType match {
case BooleanType => TSDataType.BOOLEAN
case ByteType => TSDataType.INT32
case ShortType => TSDataType.INT32
case IntegerType => TSDataType.INT32
case LongType => TSDataType.INT64
case FloatType => TSDataType.FLOAT
case DoubleType => TSDataType.DOUBLE
case StringType => TSDataType.STRING
case BinaryType => TSDataType.BLOB
case DateType => TSDataType.DATE
case TimestampType => TSDataType.STRING
case _ => {
var errMsg = s"Unable to convert Spark data type $sparkDataType to IoTDB data type."
if (sparkDataType.simpleString.toLowerCase.contains("decimal")) {
errMsg += s"For float numbers in insert into values sql, you should add the suffix 'f' or 'd' to represent float or double."
}
throw new IllegalArgumentException(errMsg)
}
}
}