diff --git a/TASMAN-core/src/main/java/it/inaf/ia2/tsm/datalayer/ADQL.java b/TASMAN-core/src/main/java/it/inaf/ia2/tsm/datalayer/ADQL.java index a91bf3dd6519241009bd8f6c989da8e5ffbc57d1..d41958b539e746e1ceecd318625cc1d990b0f944 100644 --- a/TASMAN-core/src/main/java/it/inaf/ia2/tsm/datalayer/ADQL.java +++ b/TASMAN-core/src/main/java/it/inaf/ia2/tsm/datalayer/ADQL.java @@ -47,6 +47,8 @@ public enum ADQL { CIRCLE, POLYGON; + private static final ADQL[] FIXED_LENGTH_TYPES = new ADQL[]{CHAR, BOOLEAN, SMALLINT, INTEGER, BIGINT, REAL, DOUBLE}; + /** * Returns a string representing a datatype which can't be interpreted as an * ADQL datatype (that is in case of not standard data types). Removes @@ -64,7 +66,15 @@ public enum ADQL { * @return true if the datatype has a variable length, false otherwise. */ public static boolean isVariable(ADQL adql) { - return adql.equals(VARCHAR) || adql.equals(VARBINARY) || adql.equals(CLOB) || adql.equals(BLOB); + // Since unknow data types are mapped to string, here a negative-logic is used + // (e.g. TIMESTAMP need to be considered as variable, in order to have + // arraysize *, otherwise taplib will throw an error) + for (ADQL value : FIXED_LENGTH_TYPES) { + if (adql.equals(value)) { + return false; + } + } + return true; } public static ADQL parse(String adqlStr) {