class VerticaDatabaseMeta extends BaseDatabaseMeta implements DatabaseInterface {

  @Override
  public String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean use_autoinc,
    boolean add_fieldname, boolean add_cr ) {
    String retval = "";

    String fieldname = v.getName();
    int length = v.getLength();
    // Unused in vertica
    // int precision = v.getPrecision();

    if ( add_fieldname ) {
      retval += fieldname + " ";
    }

    int type = v.getType();
    switch ( type ) {
      case ValueMetaInterface.TYPE_DATE:
      case ValueMetaInterface.TYPE_TIMESTAMP:
        retval += "TIMESTAMP";
        break;
      case ValueMetaInterface.TYPE_BOOLEAN:
        retval += "BOOLEAN";
        break;
      case ValueMetaInterface.TYPE_NUMBER:
      case ValueMetaInterface.TYPE_BIGNUMBER:
        retval += "FLOAT";
        break;
      case ValueMetaInterface.TYPE_INTEGER:
        retval += "INTEGER";
        break;
      case ValueMetaInterface.TYPE_STRING:
        retval += ( length < 1 ) ? "VARCHAR" : "VARCHAR(" + length + ")";
        break;
      case ValueMetaInterface.TYPE_BINARY:
        retval += ( length < 1 ) ? "VARBINARY" : "VARBINARY(" + length + ")";
        break;
      default:
        retval += " UNKNOWN";
        break;
    }

    if ( add_cr ) {
      retval += Const.CR;
    }

    return retval;
  }

}