apache atlas与mysql类型的对应关系

mysql类型与atlas类型对应表

Java类型 atlas类型 (typeName)
int int
bigint long
tinyint short
float float
date date
datetime date
timestamp date
byte byte
double double
decimal bigdecimal
bigint biginteger
boolean boolean
varchar string

源码片段

public abstract class AtlasBaseTypeDef implements java.io.Serializable {
    private static final long serialVersionUID = 1L;

    public static final String ATLAS_TYPE_BOOLEAN        = "boolean";
    public static final String ATLAS_TYPE_BYTE           = "byte";
    public static final String ATLAS_TYPE_SHORT          = "short";
    public static final String ATLAS_TYPE_INT            = "int";
    public static final String ATLAS_TYPE_LONG           = "long";
    public static final String ATLAS_TYPE_FLOAT          = "float";
    public static final String ATLAS_TYPE_DOUBLE         = "double";
    public static final String ATLAS_TYPE_BIGINTEGER     = "biginteger";
    public static final String ATLAS_TYPE_BIGDECIMAL     = "bigdecimal";
    public static final String ATLAS_TYPE_STRING         = "string";
    public static final String ATLAS_TYPE_DATE           = "date";
    public static final String ATLAS_TYPE_OBJECT_ID      = "objectid";

    public static final String ATLAS_TYPE_ARRAY_PREFIX    = "array<";
    public static final String ATLAS_TYPE_ARRAY_SUFFIX    = ">";
    public static final String ATLAS_TYPE_MAP_PREFIX      = "map<";
    public static final String ATLAS_TYPE_MAP_KEY_VAL_SEP = ",";
    public static final String ATLAS_TYPE_MAP_SUFFIX      = ">";

    public static final String ATLAS_TYPE_PROCESS        = "Process";
    public static final String ATLAS_TYPE_DATASET        = "DataSet";
    public static final String ATLAS_TYPE_ASSET          = "Asset";
    public static final String ATLAS_TYPE_INFRASTRUCTURE = "Infrastructure";

    public static final String TYPEDEF_OPTION_SUPPORTS_SCHEMA  = "supportsSchema";
    public static final String TYPEDEF_OPTION_SUPPORTS_PROFILE = "supportsProfile";

    public static final String[] ATLAS_PRIMITIVE_TYPES = {
        ATLAS_TYPE_BOOLEAN,
        ATLAS_TYPE_BYTE,
        ATLAS_TYPE_SHORT,
        ATLAS_TYPE_INT,
        ATLAS_TYPE_LONG,
        ATLAS_TYPE_FLOAT,
        ATLAS_TYPE_DOUBLE,
        ATLAS_TYPE_BIGINTEGER,
        ATLAS_TYPE_BIGDECIMAL,
        ATLAS_TYPE_STRING,
    };
    /**
     * The list of types that are valid for relationships. These are the
     * primitive attributes and date.
     */
    public static final String[] ATLAS_RELATIONSHIP_ATTRIBUTE_TYPES = { ATLAS_TYPE_BOOLEAN,
            ATLAS_TYPE_BYTE,
            ATLAS_TYPE_SHORT,
            ATLAS_TYPE_INT,
            ATLAS_TYPE_LONG,
            ATLAS_TYPE_FLOAT,
            ATLAS_TYPE_DOUBLE,
            ATLAS_TYPE_BIGINTEGER,
            ATLAS_TYPE_BIGDECIMAL,
            ATLAS_TYPE_STRING,
            ATLAS_TYPE_DATE
    };

    public static final String[] ATLAS_BUILTIN_TYPES = {
        ATLAS_TYPE_BOOLEAN,
        ATLAS_TYPE_BYTE,
        ATLAS_TYPE_SHORT,
        ATLAS_TYPE_INT,
        ATLAS_TYPE_LONG,
        ATLAS_TYPE_FLOAT,
        ATLAS_TYPE_DOUBLE,
        ATLAS_TYPE_BIGINTEGER,
        ATLAS_TYPE_BIGDECIMAL,
        ATLAS_TYPE_STRING,

        ATLAS_TYPE_DATE,
        ATLAS_TYPE_OBJECT_ID,
    };

    public static final String     SERVICE_TYPE_ATLAS_CORE    = "atlas_core";
    public static final String     SERIALIZED_DATE_FORMAT_STR = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";

    @Deprecated
    public static final DateFormat DATE_FORMATTER             = new SimpleDateFormat(SERIALIZED_DATE_FORMAT_STR);

    static {
        DATE_FORMATTER.setTimeZone(TimeZone.getTimeZone("UTC"));
    }

    public static DateFormat getDateFormatter() {
        return THREAD_LOCAL_DATE_FORMAT.get();
    }

    private static final ThreadLocal<DateFormat> THREAD_LOCAL_DATE_FORMAT = new ThreadLocal<DateFormat>() {
        @Override
        public DateFormat initialValue() {
            DateFormat ret = new SimpleDateFormat(SERIALIZED_DATE_FORMAT_STR);

            ret.setTimeZone(TimeZone.getTimeZone("UTC"));

            return ret;
        }
    };

    private final TypeCategory category;
    private String  guid       = null;
    private String  createdBy  = null;
    private String  updatedBy  = null;
    private Date    createTime = null;
    private Date    updateTime = null;
    private Long    version    = null;
    private String  name;
    private String  description;
    private String  typeVersion;
    private String  serviceType;
    private Map<String, String> options;
}

你可能感兴趣的:(java,开发语言)