use of com.netflix.metacat.connector.hive.converters.HiveTypeConverter in project metacat by Netflix.
the class PolarisConnectorTableServiceTest method init.
/**
* Initialization.
*/
@BeforeEach
public void init() {
connectorContext = new ConnectorContext(CATALOG_NAME, CATALOG_NAME, "polaris", new DefaultConfigImpl(new MetacatProperties()), new NoopRegistry(), null, Maps.newHashMap());
polarisDBService = new PolarisConnectorDatabaseService(polarisStoreService, connectorContext);
polarisTableService = new PolarisConnectorTableService(polarisStoreService, CATALOG_NAME, polarisDBService, new HiveConnectorInfoConverter(new HiveTypeConverter()), new IcebergTableHandler(connectorContext, new IcebergTableCriteriaImpl(connectorContext), new IcebergTableOpWrapper(connectorContext, serviceManager), new IcebergTableOpsProxy()), new PolarisTableMapper(CATALOG_NAME), connectorContext);
}
use of com.netflix.metacat.connector.hive.converters.HiveTypeConverter in project metacat by Netflix.
the class HiveConnectorFastTableService method get.
/**
* getTable.
*
* @param requestContext The request context
* @param name The qualified name of the resource to get
* @return table dto
*/
@Override
public TableInfo get(final ConnectorRequestContext requestContext, final QualifiedName name) {
try {
final TableInfo info = super.get(requestContext, name);
if (connectorContext.getConfig().isCommonViewEnabled() && HiveTableUtil.isCommonView(info)) {
final String tableLoc = HiveTableUtil.getCommonViewMetadataLocation(info);
return hiveConnectorFastTableServiceProxy.getCommonViewTableInfo(name, tableLoc, info, new HiveTypeConverter(), connectorContext.getConfig().isIcebergCacheEnabled());
}
if (!connectorContext.getConfig().isIcebergEnabled() || !HiveTableUtil.isIcebergTable(info)) {
return info;
}
final String tableLoc = HiveTableUtil.getIcebergTableMetadataLocation(info);
final TableInfo result = hiveConnectorFastTableServiceProxy.getIcebergTable(name, tableLoc, info, requestContext.isIncludeMetadata(), connectorContext.getConfig().isIcebergCacheEnabled());
// Renamed tables could still be cached with the old table name.
// Set it to the qName in the request.
result.setName(name);
return result;
} catch (IllegalStateException e) {
throw handleException(e);
}
}
Aggregations