/** * Remove redundant metadata like TAP-1.0 xtypes for primitive columns. * * @param td */ protected void sanitizeTable(TableDesc td) { for (ColumnDesc cd : td.getColumnDescs()) { String xtype = cd.getDatatype().xtype; if (TapConstants.TAP10_TIMESTAMP.equals(xtype)) cd.getDatatype().xtype = "timestamp"; // DALI-1.1 if (oldXtypes.contains(xtype)) cd.getDatatype().xtype = null; } } // TAP-1.0 xtypes that can just be dropped from ColumnDesc
@Override public String getIndexUsingQualifier(ColumnDesc columnDesc, boolean unique) { TypePair tp = findTypePair(columnDesc.getDatatype()); switch(tp.str) { case "spoint": case "scircle": case "spoly": case "polygon": if (unique) { throw new IllegalArgumentException("unique index not supported for column type: " + columnDesc.getDatatype()); } return "gist"; default: return null; } }
/** * * @param columnDesc * @return data type code for use in PreparedStatement set methods */ @Override public Integer getType(ColumnDesc columnDesc) { TapDataType tt = columnDesc.getDatatype(); TypePair dbt = findTypePair(tt); return dbt.num; }
/** * Create a VOTableField from a ColumnDesc. * * @param column * @return The associated VOTableField */ public static VOTableField convert(ColumnDesc column) { VOTableField vtf = new VOTableField( column.getColumnName(), column.getDatatype().getDatatype(), column.getDatatype().arraysize); vtf.xtype = column.getDatatype().xtype; return vtf; }
/** * A normal column with an alternate name (alias). * All metadata is copied from the specified column descriptor. * * @param name * @param column */ public TapSelectItem(String name, ColumnDesc column) { this(name, column.getDatatype()); this.columnName = column.getColumnName(); this.tableName = column.getTableName(); this.description = column.description; this.id = column.id; this.indexed = column.indexed; this.principal = column.principal; this.std = column.std; this.ucd = column.ucd; this.unit = column.unit; this.utype = column.utype; }
safeSetString(sb, ps, col++, column.ucd); safeSetString(sb, ps, col++, column.unit); safeSetString(sb, ps, col++, column.getDatatype().getDatatype()); safeSetString(sb, ps, col++, column.getDatatype().arraysize); safeSetString(sb, ps, col++, column.getDatatype().xtype); safeSetBoolean(sb, ps, col++, column.principal); safeSetBoolean(sb, ps, col++, column.indexed);
TapDataType tt = columnDesc.getDatatype(); TypePair dbt = findTypePair(tt); if (dbt == null) {
if (!cd.getDatatype().equals(ncd.getDatatype())) { throw new UnsupportedOperationException("cannot change column type: " + cd.getColumnName() + " " + cd.getDatatype() + " -> " + ncd.getDatatype());
tableDesc.getTableName()); ColumnDesc newColumnDesc = new ColumnDesc(columnDesc.getTableName(), columnDesc.getColumnName(), columnDesc.getDatatype()); newTableDesc.getColumnDescs().add(newColumnDesc); if (tapSchemaParameters == null)
TapDataType tt = columnDesc.getDatatype(); if (BLOB.equalsIgnoreCase(tt.xtype)) throw new IllegalArgumentException("The column [" + column
if (columnDesc != null) datatype = columnDesc.getDatatype();
addChild(eleColumn, "utype", cd.utype); TapDataType tt = cd.getDatatype();