Fix TestingConnectorContext.getTypeManager
The TypeRegistry instantiated in this test context was not associated with
a FunctionRegistry.
@@ -15,8 +15,10 @@ package com.facebook.presto.testing;
import com.facebook.presto.GroupByHashPageIndexerFactory;
import com.facebook.presto.PagesIndexPageSorter;
+import com.facebook.presto.block.BlockEncodingManager;
import com.facebook.presto.connector.ConnectorAwareNodeManager;
import com.facebook.presto.connector.ConnectorId;
+import com.facebook.presto.metadata.FunctionRegistry;
import com.facebook.presto.metadata.InMemoryNodeManager;
import com.facebook.presto.operator.PagesIndex;
import com.facebook.presto.spi.NodeManager;
@@ -24,6 +26,7 @@ import com.facebook.presto.spi.PageIndexerFactory;
import com.facebook.presto.spi.PageSorter;
import com.facebook.presto.spi.connector.ConnectorContext;
import com.facebook.presto.spi.type.TypeManager;
+import com.facebook.presto.sql.analyzer.FeaturesConfig;
import com.facebook.presto.sql.gen.JoinCompiler;
import com.facebook.presto.type.TypeRegistry;
@@ -35,6 +38,12 @@ public class TestingConnectorContext
private final PageSorter pageSorter = new PagesIndexPageSorter(new PagesIndex.TestingFactory());
private final PageIndexerFactory pageIndexerFactory = new GroupByHashPageIndexerFactory(new JoinCompiler());
+ public TestingConnectorContext()
+ {
+ // associate typeManager with a function registry
+ new FunctionRegistry(typeManager, new BlockEncodingManager(typeManager), new FeaturesConfig());
+ }
+
@Override
public NodeManager getNodeManager()
{
