Source:
public void testDropKVColumn() throws Exception { long ts = nextTimestamp(); String tenantId = getOrganizationId(); initATableValues("aTable", tenantId, getDefaultSplits(tenantId), null, ts, getUrl()); Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5)); Connection conn5 = DriverManager.getConnection(getUrl(), props); assertTrue(conn5.createStatement().executeQuery("SELECT 1 FROM atable WHERE b_string IS NOT NULL").next()); conn5.createStatement().executeUpdate("ALTER TABLE " + ATABLE_NAME + " DROP COLUMN b_string"); conn5.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 6)); Connection conn2 = DriverManager.getConnection(getUrl(), props); String query = "SELECT b_string FROM aTable"; try { conn2.prepareStatement(query).executeQuery().next(); fail(); } catch (ColumnNotFoundException e) { } conn2.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 3)); Connection conn3 = DriverManager.getConnection(getUrl(), props); assertTrue(conn3.prepareStatement(query).executeQuery().next()); conn3.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 7)); Connection conn7 = DriverManager.getConnection(getUrl(), props); conn7.createStatement().executeUpdate("ALTER TABLE " + ATABLE_NAME + " ADD b_string VARCHAR"); conn7.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 8)); Connection conn8 = DriverManager.getConnection(getUrl(), props); assertFalse(conn8.createStatement().executeQuery("SELECT 1 FROM atable WHERE b_string IS NOT NULL").next()); conn8.close(); }

Target:
public void testDropKVColumn() throws Exception { long ts = nextTimestamp(); String tenantId = getOrganizationId(); initATableValues(ATABLE_NAME, tenantId, getDefaultSplits(tenantId), null, ts, getUrl()); Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 5)); Connection conn5 = DriverManager.getConnection(getUrl(), props); assertTrue(conn5.createStatement().executeQuery("SELECT 1 FROM atable WHERE b_string IS NOT NULL").next()); conn5.createStatement().executeUpdate("ALTER TABLE " + ATABLE_NAME + " DROP COLUMN b_string"); conn5.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 6)); Connection conn2 = DriverManager.getConnection(getUrl(), props); String query = "SELECT b_string FROM aTable"; try { conn2.prepareStatement(query).executeQuery().next(); fail(); } catch (ColumnNotFoundException e) { } conn2.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 3)); Connection conn3 = DriverManager.getConnection(getUrl(), props); assertTrue(conn3.prepareStatement(query).executeQuery().next()); conn3.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 7)); Connection conn7 = DriverManager.getConnection(getUrl(), props); conn7.createStatement().executeUpdate("ALTER TABLE " + ATABLE_NAME + " ADD b_string VARCHAR"); conn7.close(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 8)); Connection conn8 = DriverManager.getConnection(getUrl(), props); assertFalse(conn8.createStatement().executeQuery("SELECT 1 FROM atable WHERE b_string IS NOT NULL").next()); conn8.close(); }