BaseSimbaDatabaseMeta extends Hive2DatabaseMeta { @Override public String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean useAutoinc, boolean addFieldname, boolean addCr ) { StringBuilder retval = new StringBuilder(); String fieldname = v.getName(); int length = v.getLength(); int precision = v.getPrecision(); if ( addFieldname ) { retval.append( fieldname ).append( ' ' ); } int type = v.getType(); switch ( type ) { case ValueMetaInterface.TYPE_BOOLEAN: retval.append( "BOOLEAN" ); break; case ValueMetaInterface.TYPE_DATE: retval.append( "DATE" ); break; case ValueMetaInterface.TYPE_TIMESTAMP: retval.append( "TIMESTAMP" ); break; case ValueMetaInterface.TYPE_STRING: retval.append( "VARCHAR" ); break; case ValueMetaInterface.TYPE_NUMBER: case ValueMetaInterface.TYPE_INTEGER: case ValueMetaInterface.TYPE_BIGNUMBER: if ( precision == 0 ) { if ( length > 9 ) { if ( length < 19 ) { retval.append( "BIGINT" ); } else { retval.append( "FLOAT" ); } } else { retval.append( "INT" ); } } else { if ( length > 15 ) { retval.append( "FLOAT" ); } else { retval.append( "DOUBLE" ); } } break; } return retval.toString(); } BaseSimbaDatabaseMeta( DriverLocator driverLocator, NamedClusterService namedClusterService,
                         MetastoreLocator metastoreLocator ); @Override abstract String getDriverClass(); @Override int[] getAccessTypeList(); @Override String getURL( String hostname, String port, String databaseName ); @Override String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean useAutoinc,
                                    boolean addFieldname, boolean addCr );  }
@Test public void testGetFieldDefinition() { assertGetFieldDefinition( new ValueMetaInternetAddress(), "internetAddressName", "" ); }