com.alibaba.fastsql.util.OdpsUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastsql Show documentation
Show all versions of fastsql Show documentation
An JDBC datasource implementation.
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);
}
}