Example usage for org.apache.spark.sql.types DataTypes CalendarIntervalType

List of usage examples for org.apache.spark.sql.types DataTypes CalendarIntervalType

Introduction

In this page you can find the example usage for org.apache.spark.sql.types DataTypes CalendarIntervalType.

Prototype

DataType CalendarIntervalType

To view the source code for org.apache.spark.sql.types DataTypes CalendarIntervalType.

Click Source Link

Document

Gets the CalendarIntervalType object.

Usage

From source file:org.icgc.dcc.release.job.export.util.SchemaGenerator.java

License:Open Source License

private static DataType parseDataType(String dataTypeString) {
    switch (dataTypeString) {
    case "StringType":
        return DataTypes.StringType;
    case "BinaryType":
        return DataTypes.BinaryType;
    case "BooleanType":
        return DataTypes.BooleanType;
    case "DateType":
        return DataTypes.DateType;
    case "TimestampType":
        return DataTypes.TimestampType;
    case "CalendarIntervalType":
        return DataTypes.CalendarIntervalType;
    case "DoubleType":
        return DataTypes.DoubleType;
    case "ByteType":
        return DataTypes.ByteType;
    case "IntegerType":
        return DataTypes.IntegerType;
    case "LongType":
        return DataTypes.LongType;
    case "ShortType":
        return DataTypes.ShortType;
    case "NullType":
        return DataTypes.NullType;
    default:/*from  w ww . ja  va 2 s  .c  o m*/
        throw new IllegalArgumentException(format("Unknown datatype %s", dataTypeString));
    }
}