FarragoTypeSystems
From LucidDB Wiki
This page provides an overview of the different type systems encompassed by Farrago.
A presentation is available (OpenOffice format): Media:EigenbaseTypeSystem.sxi
Contents |
Type Systems
| Type System | Definition | Extensibility |
| SQL:2003 | ISO/IEC 9075:2003 Part 2 Section 4 | UDT's defined in either Java or SQL |
| JDBC | java.sql.Types, {ResultSet|Parameter|Database}MetaData; see JdbcDataTypes | Connection.setTypeMap, SQLData |
| validator/optimizer | org.eigenbase.reltype | RelDataTypeFactory |
| catalog | CWM/FEM | via UML subclassing |
| Fennel | fennel/tuple, fennel/disruptivetech/calc | StoredTypeDescriptorFactory |
| Java runtime | net.sf.farrago.type.runtime | via ojrex code generation |
SQL:2003
Predefined Types
- CHAR, VARCHAR (char set, collation: not supported yet)
- CLOB, BLOB, DATALINK (not supported yet)
- SMALLINT, INTEGER, BIGINT
- NUMERIC, DECIMAL (see NumericType)
- REAL, FLOAT, DOUBLE
- BOOLEAN
- DATE, TIME, TIMESTAMP (see FarragoDatetimeTypes; fractional seconds, timezone: not supported yet)
- INTERVAL (half-baked)
- BINARY, VARBINARY, TINYINT (Eigenbase extensions to match common vendor support)
Constructed Types
- ARRAY (not supported yet)
- MULTISET (half-baked)
- REF (don't intend to support)
- ROW (half-baked)
User-Defined Types
- Structured types (methods, inheritance, and user-defined casts: not supported yet)
- Distinct types
- SQL/JRT types based on Java classes (not supported yet)
CWM
Builtin type descriptors are initialized in the repository as follows (per Table 22-5-1 in the CWM 1.0 spec):
SQL-99 Data Type Instance of Attributes
================ =========== ==========
CHARACTER TypeAlias alias for CHAR
VARYING
CHAR SQLSimpleType characterMaximumLength = 65535
characterOctetLength = null (defined in
Column)
numericPrecision = null
numericPrecisionRadix = null
numericScale = null
dateTimePrecision = null
CHARACTER TypeAlias alias for VARCHAR
VARYING
VARCHAR SQLSimpleType characterMaximumLength = 65535
characterOctetLength = null (defined in
Column)
numericPrecision = null
numericPrecisionRadix = null
numericScale = null
dateTimePrecision = null
VARBINARY SQLSimpleType characterMaximumLength = 65535
characterOctetLength = null (defined in
Column)
numericPrecision = null
numericPrecisionRadix = null
numericScale = null
dateTimePrecision = null
BINARY SQLSimpleType characterMaximumLength = 65535
characterOctetLength = null (defined in
Column)
numericPrecision = null
numericPrecisionRadix = null
numericScale = null
dateTimePrecision = null
DEC TypeAlias alias for DECIMAL
DECIMAL SQLSimpleType characterMaximumLength = null
characterOctetLength = null
numericPrecision = 19 (actual defined in Column)
numericPrecisionRadix = 10
numericScale = 19 (actual defined in
Column)
dateTimePrecision = null
BIGINT SQLSimpleType characterMaximumLength = null
characterOctetLength = null
numericPrecision = 64
numericPrecisionRadix = 2
numericScale = 0
dateTimePrecision = null
INTEGER SQLSimpleType characterMaximumLength = null
characterOctetLength = null
numericPrecision = 32
numericPrecisionRadix = 2
numericScale = 0
dateTimePrecision = null
SMALLINT SQLSimpleType characterMaximumLength = null
characterOctetLength = null
numericPrecision = 16
numericPrecisionRadix = 2
numericScale = 0
dateTimePrecision = null
TINYINT SQLSimpleType characterMaximumLength = null
characterOctetLength = null
numericPrecision = 8
numericPrecisionRadix = 2
numericScale = 0
dateTimePrecision = null
FLOAT TypeAlias alias for DOUBLE PRECISION
REAL SQLSimpleType characterMaximumLength = null
characterOctetLength = null
numericPrecision = 23
numericPrecisionRadix = 2
numericScale = null
dateTimePrecision = null
DOUBLE PRECISION TypeAlias alias for DOUBLE
DOUBLE SQLSimpleType characterMaximumLength = null
characterOctetLength = null
numericPrecision = 52
numericPrecisionRadix = 2
numericScale = null
dateTimePrecision = null
BOOLEAN SQLSimpleType characterMaximumLength = null
characterOctetLength = null
numericPrecision = null
numericPrecisionRadix = null
numericScale = null
dateTimePrecision = null
DATE SQLSimpleType characterMaximumLength = null
characterOctetLength = null
numericPrecision = null
numericPrecisionRadix = null
numericScale = null
dateTimePrecision = 0
TIME SQLSimpleType characterMaximumLength = null
characterOctetLength = null
numericPrecision = null
numericPrecisionRadix = null
numericScale = null
dateTimePrecision = 0
TIMESTAMP SQLSimpleType characterMaximumLength = null
characterOctetLength = null
numericPrecision = null
numericPrecisionRadix = null
numericScale = null
dateTimePrecision = 0
(NUMERIC is mapped to DECIMAL by the parser, so there is no corresponding repository entry.)



