Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 8.1.15 - 2025-11-27
### Changed
- When sending the events we hash based on db and table name. By default we are taking the newest table name.
We realised this could potentially break the order of operations because it will send the event to a different kafka partition.

## 8.1.14 - 2025-11-25
### Changed
- Remove metric relocations for apiary-gluesync-listener because Spring doesn't find those in bean initialisation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.hadoop.hive.metastore.events.AlterTableEvent;

public class ApiaryAlterTableEvent extends ApiaryListenerEvent {

private static final long serialVersionUID = 1L;

private Table oldTable;
Expand All @@ -36,12 +37,12 @@ public ApiaryAlterTableEvent(AlterTableEvent event) {

@Override
public String getDatabaseName() {
return newTable.getDbName();
return oldTable.getDbName();
}

@Override
public String getTableName() {
return newTable.getTableName();
return oldTable.getTableName();
}

public Table getOldTable() {
Expand All @@ -63,5 +64,4 @@ public boolean equals(Object obj) {
ApiaryAlterTableEvent other = (ApiaryAlterTableEvent) obj;
return super.equals(other) && Objects.equals(oldTable, other.oldTable) && Objects.equals(newTable, other.newTable);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
@RunWith(MockitoJUnitRunner.class)
public class SerializableAlterTableEventTest {

private static final String NEW_DATABASE = "new_db";
private static final String NEW_TABLE = "new_tbl";
private static final String OLD_DATABASE = "old_db";
private static final String OLD_TABLE = "old_tbl";

private @Mock AlterTableEvent alterTableEvent;
private @Mock Table newTable;
Expand All @@ -40,21 +40,21 @@ public class SerializableAlterTableEventTest {

@Before
public void init() {
when(newTable.getDbName()).thenReturn(NEW_DATABASE);
when(newTable.getTableName()).thenReturn(NEW_TABLE);
when(oldTable.getDbName()).thenReturn(OLD_DATABASE);
when(oldTable.getTableName()).thenReturn(OLD_TABLE);
when(alterTableEvent.getNewTable()).thenReturn(newTable);
when(alterTableEvent.getOldTable()).thenReturn(oldTable);
event = new ApiaryAlterTableEvent(alterTableEvent);
}

@Test
public void databaseName() {
assertThat(event.getDatabaseName()).isEqualTo(NEW_DATABASE);
assertThat(event.getDatabaseName()).isEqualTo(OLD_DATABASE);
}

@Test
public void tableName() {
assertThat(event.getTableName()).isEqualTo(NEW_TABLE);
assertThat(event.getTableName()).isEqualTo(OLD_TABLE);
}

@Test
Expand All @@ -67,5 +67,4 @@ public void tables() {
assertThat(event.getNewTable()).isSameAs(newTable);
assertThat(event.getOldTable()).isSameAs(oldTable);
}

}
Loading