class VerticaDatabaseMeta extends BaseDatabaseMeta implements IDatabase {

  @Override
  public String getFieldDefinition( IValueMeta v, String tk, String pk, boolean useAutoinc,
                                    boolean addFieldname, boolean addCr ) {
    String retval = "";

    String fieldname = v.getName();
    int length = v.getLength();

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

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

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

    return retval;
  }

}