Skip to content

Commit

Permalink
Provide better onDataChanged overload
Browse files Browse the repository at this point in the history
  • Loading branch information
findepi committed Jun 14, 2021
1 parent 726b865 commit 8a3aa91
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public JdbcOutputTableHandle beginInsertTable(ConnectorSession session, JdbcTabl
public void finishInsertTable(ConnectorSession session, JdbcOutputTableHandle handle)
{
delegate.finishInsertTable(session, handle);
invalidateCache(statisticsCache, key -> key.tableHandle.references(new SchemaTableName(handle.getSchemaName(), handle.getTableName())));
onDataChanged(new SchemaTableName(handle.getSchemaName(), handle.getTableName()));
}

@Override
Expand Down Expand Up @@ -435,6 +435,17 @@ public Optional<TableScanRedirectApplicationResult> getTableScanRedirection(Conn
return delegate.getTableScanRedirection(session, tableHandle);
}

public void onDataChanged(SchemaTableName table)
{
invalidateCache(statisticsCache, key -> key.tableHandle.references(table));
}

/**
* @deprecated {@link JdbcTableHandle} is not a good representation of the table. For example, we don't want
* to distinguish between "a plan table" and "table with selected columns", or "a table with a constraint" here.
* Use {@link #onDataChanged(SchemaTableName)}, which avoids these ambiguities.
*/
@Deprecated
public void onDataChanged(JdbcTableHandle handle)
{
invalidateCache(statisticsCache, key -> key.tableHandle.equals(handle));
Expand Down

0 comments on commit 8a3aa91

Please sign in to comment.