Hive2DatabaseMeta extends DatabaseMetaWithVersion { @Override public String getModifyColumnStatement( String tablename, ValueMetaInterface v, String tk, boolean useAutoinc, String pk, boolean semicolon ) { return "ALTER TABLE " + tablename + " MODIFY " + getFieldDefinition( v, tk, pk, useAutoinc, true, false ); } Hive2DatabaseMeta( DriverLocator driverLocator, NamedClusterService namedClusterService,
                            MetastoreLocator metastoreLocator ); @Override int[] getAccessTypeList(); @Override String getAddColumnStatement( String tablename, ValueMetaInterface v, String tk, boolean useAutoinc,
                                       String pk, boolean semicolon ); @Override String getDriverClass(); @Override String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean useAutoinc,
                                    boolean addFieldname, boolean addCr ); @Override String getModifyColumnStatement( String tablename, ValueMetaInterface v, String tk, boolean useAutoinc,
                                          String pk, boolean semicolon ); @Override String getURL( String hostname, String port, String databaseName ); @Override String[] getUsedLibraries(); @Override String getSelectCountStatement( String tableName ); @Override String generateColumnAlias( int columnIndex, String suggestedName ); String getStartQuote(); String getEndQuote(); @Override String[] getTableTypes(); @Override String[] getViewTypes(); @Override String getTruncateTableStatement( String tableName ); @Override boolean supportsSetCharacterStream(); @Override boolean supportsBatchUpdates(); @Override boolean supportsTimeStampToDateConversion(); @Override List<String> getNamedClusterList(); @Override void putOptionalOptions( Map<String, String> extraOptions ); static final String URL_PREFIX; static final String SELECT_COUNT_1_FROM; static final String ALIAS_SUFFIX; static final String VIEW; static final String VIRTUAL_VIEW; static final String TRUNCATE_TABLE; static final int[] ACCESS_TYPE_LIST; }
@Test public void testGetModifyColumnStatement() { String testTable = "testTable"; String booleanCol = "booleanCol"; ValueMetaInterface valueMetaInterface = new ValueMetaBoolean(); valueMetaInterface.setName( booleanCol ); String addColumnStatement = hive2DatabaseMeta.getModifyColumnStatement( testTable, valueMetaInterface, null, false, null, false ); assertTrue( addColumnStatement.contains( "BOOLEAN" ) ); assertTrue( addColumnStatement.contains( testTable ) ); assertTrue( addColumnStatement.contains( booleanCol ) ); }