@Test public void testColumnAlias_060_And_Later() throws Throwable { when( driver.getMajorVersion() ).thenReturn( 0 ); when( driver.getMinorVersion() ).thenReturn( 6 ); String alias = hiveDatabaseMeta.generateColumnAlias( 0, "alias" ); assertEquals( "alias", alias ); alias = hiveDatabaseMeta.generateColumnAlias( 1, "alias1" ); assertEquals( "alias1", alias ); alias = hiveDatabaseMeta.generateColumnAlias( 2, "alias2" ); assertEquals( "alias2", alias ); }
@Override public String generateColumnAlias( int columnIndex, String suggestedName ) { if ( isDriverVersion( 0, 6 ) ) { return suggestedName; } else { return "_col" + String.valueOf( columnIndex ); } }
HiveDatabaseMeta extends DatabaseMetaWithVersion { @Override public String generateColumnAlias( int columnIndex, String suggestedName ) { if ( isDriverVersion( 0, 6 ) ) { return suggestedName; } else { return "_col" + String.valueOf( columnIndex ); } } }
HiveDatabaseMeta extends DatabaseMetaWithVersion { @Override public String generateColumnAlias( int columnIndex, String suggestedName ) { if ( isDriverVersion( 0, 6 ) ) { return suggestedName; } else { return "_col" + String.valueOf( columnIndex ); } } HiveDatabaseMeta( DriverLocator driverLocator ); }
HiveDatabaseMeta extends DatabaseMetaWithVersion { @Override public String generateColumnAlias( int columnIndex, String suggestedName ) { if ( isDriverVersion( 0, 6 ) ) { return suggestedName; } else { return "_col" + String.valueOf( columnIndex ); } } HiveDatabaseMeta( DriverLocator driverLocator ); @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 int getDefaultDatabasePort(); @Override String[] getTableTypes(); @Override String[] getViewTypes(); @Override String getTruncateTableStatement( String tableName ); @Override boolean supportsSetCharacterStream(); @Override boolean supportsBatchUpdates(); @Override boolean supportsTimeStampToDateConversion(); }
HiveDatabaseMeta extends DatabaseMetaWithVersion { @Override public String generateColumnAlias( int columnIndex, String suggestedName ) { if ( isDriverVersion( 0, 6 ) ) { return suggestedName; } else { return "_col" + String.valueOf( columnIndex ); } } HiveDatabaseMeta( DriverLocator driverLocator ); @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 int getDefaultDatabasePort(); @Override String[] getTableTypes(); @Override String[] getViewTypes(); @Override String getTruncateTableStatement( String tableName ); @Override boolean supportsSetCharacterStream(); @Override boolean supportsBatchUpdates(); @Override boolean supportsTimeStampToDateConversion(); static final String URL_PREFIX; static final String SELECT_COUNT_1_FROM; static final String VIEW; static final String VIRTUAL_VIEW; static final String TRUNCATE_TABLE; }