Search code examples
iccube

icCube definition of the icc-schema.xml


In the icc-schema.xml jdbcDatatable column there is a tableType and a type attribute.

Example:

column name="first_opened_date" tableType="TIMESTAMP" type="DATETIME" selected="true" primaryKey="false"

column name="prepared_food" tableType="BIT" type="BOOLEAN" selected="true" primaryKey="false"

I guessed the tableType refers to the data type as defined in the database and the type is an icCube internal identifier roughly related to java.sql.Types.

If this is right, the former [tableType] can be read from the java.sql.Metadata.getColumns.getString("TYPE_NAME") and the later [type] must be inferred from the java.sql.Metadata.getColumns.getString("DATA_TYPE").

Is my guessing correct? Do you have a correspondence table? What is the impact of a wrong or missing attributes?


Solution

  • Assuming we are talking about JDBC tables.

    "tableType" is not used as such within the code; it is displayed as an indication. The name is derived from the java.sql.Types integer as returned by the meta-information.

    "type" is the actual data type of the column. Values read from the DB are converted to this data type and then used to build dimensions and facts. This is the type displayed in the table UI as "Output Type". Possible values are:

    DATE     
    DATETIME
    BOOLEAN
    DOUBLE
    FLOAT
    SHORT
    INTEGER
    LONG
    STRING
    UPPERCASE_STRING
    JAVA_OBJECT
    DB_TYPE_UNSUPPORTED
    

    The mapping from java.sql.Types is as following:

    DATE                from: Types.DATE
    DATETIME            from: Types.TIMESTAMP
    BOOLEAN             from: Types.BIT, Types.BOOLEAN
    DOUBLE              from: Types.FLOAT, Types.DOUBLE, Types.NUMERIC, Types.DECIMAL
    FLOAT               from: Types.REAL
    SHORT               from: Types.TINYINT, Types.SMALLINT
    INTEGER             from: Types.INTEGER
    LONG                from: Types.BIGINT, Types.ROWID
    STRING              from: Types.VARCHAR, Types.LONGVARCHAR, Types.NVARCHAR, Types.LONGNVARCHAR, Types.CHAR, Types.NCHAR
    UPPERCASE_STRING    from: n/a
    JAVA_OBJECT         from: Types.JAVA_OBJECT
    DB_TYPE_UNSUPPORTED from: n/a
    

    Hope that helps.