Search in sources :

Example 1 with HiveTypeConverter

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);
}
Also used : HiveTypeConverter(com.netflix.metacat.connector.hive.converters.HiveTypeConverter) IcebergTableOpsProxy(com.netflix.metacat.connector.hive.iceberg.IcebergTableOpsProxy) PolarisTableMapper(com.netflix.metacat.connector.polaris.mappers.PolarisTableMapper) IcebergTableHandler(com.netflix.metacat.connector.hive.iceberg.IcebergTableHandler) IcebergTableCriteriaImpl(com.netflix.metacat.connector.hive.iceberg.IcebergTableCriteriaImpl) DefaultConfigImpl(com.netflix.metacat.common.server.properties.DefaultConfigImpl) MetacatProperties(com.netflix.metacat.common.server.properties.MetacatProperties) NoopRegistry(com.netflix.spectator.api.NoopRegistry) ConnectorContext(com.netflix.metacat.common.server.connectors.ConnectorContext) IcebergTableOpWrapper(com.netflix.metacat.connector.hive.iceberg.IcebergTableOpWrapper) HiveConnectorInfoConverter(com.netflix.metacat.connector.hive.converters.HiveConnectorInfoConverter) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with HiveTypeConverter

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);
    }
}
Also used : HiveTypeConverter(com.netflix.metacat.connector.hive.converters.HiveTypeConverter) TableInfo(com.netflix.metacat.common.server.connectors.model.TableInfo)

Aggregations

HiveTypeConverter (com.netflix.metacat.connector.hive.converters.HiveTypeConverter)2 ConnectorContext (com.netflix.metacat.common.server.connectors.ConnectorContext)1 TableInfo (com.netflix.metacat.common.server.connectors.model.TableInfo)1 DefaultConfigImpl (com.netflix.metacat.common.server.properties.DefaultConfigImpl)1 MetacatProperties (com.netflix.metacat.common.server.properties.MetacatProperties)1 HiveConnectorInfoConverter (com.netflix.metacat.connector.hive.converters.HiveConnectorInfoConverter)1 IcebergTableCriteriaImpl (com.netflix.metacat.connector.hive.iceberg.IcebergTableCriteriaImpl)1 IcebergTableHandler (com.netflix.metacat.connector.hive.iceberg.IcebergTableHandler)1 IcebergTableOpWrapper (com.netflix.metacat.connector.hive.iceberg.IcebergTableOpWrapper)1 IcebergTableOpsProxy (com.netflix.metacat.connector.hive.iceberg.IcebergTableOpsProxy)1 PolarisTableMapper (com.netflix.metacat.connector.polaris.mappers.PolarisTableMapper)1 NoopRegistry (com.netflix.spectator.api.NoopRegistry)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1