Expose extra information from RuleTester
Some rules need the query's Metadata as an argument. Also, in order to
construct a proper TableScanNode, you need the ConnectorId from the
Metadata.
@@ -83,6 +83,16 @@ public class RuleTester
queryRunner.close();
}
+ public Metadata getMetadata()
+ {
+ return metadata;
+ }
+
+ public ConnectorId getCurrentConnectorId()
+ {
+ return queryRunner.inTransaction(transactionSession -> metadata.getCatalogHandle(transactionSession, session.getCatalog().get())).get();
+ }
+
private class RuleSetAdapter
implements Rule
{
