All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alibaba.fastsql.util.OdpsUtils Maven / Gradle / Ivy

There is a newer version: 2.0.0_preview_973
Show newest version
package com.alibaba.fastsql.util;

import java.util.HashSet;
import java.util.Set;

public class OdpsUtils {
    private static Set builtinDataTypes;

    public static boolean isBuiltinDataType(String dataType) {
        if (dataType == null) {
            return false;
        }

        String table_lower = dataType.toLowerCase();

        Set dataTypes = builtinDataTypes;

        if (dataTypes == null) {
            dataTypes = new HashSet();
            loadDataTypes(dataTypes);
            builtinDataTypes = dataTypes;
        }

        return dataTypes.contains(table_lower);
    }

    public static void loadDataTypes(Set dataTypes) {
        Utils.loadFromFile("META-INF/fastsql/parser/odps/builtin_datatypes", dataTypes);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy