Search in sources :

Example 6 with ScanStats

use of org.apache.drill.exec.physical.base.ScanStats in project drill by apache.

the class HiveScan method getScanStats.

@Override
public ScanStats getScanStats() {
    try {
        final HiveStats stats = metadataProvider.getStats(hiveReadEntry);
        logger.debug("HiveStats: {}", stats.toString());
        // Hive's native reader is neither memory efficient nor fast. Increase the CPU cost
        // by a factor to let the planner choose HiveDrillNativeScan over HiveScan with SerDes.
        float cpuCost = 1 * getSerDeOverheadFactor();
        return new ScanStats(GroupScanProperty.NO_EXACT_ROW_COUNT, stats.getNumRows(), cpuCost, stats.getSizeInBytes());
    } catch (final IOException e) {
        throw new DrillRuntimeException(e);
    }
}
Also used : HiveStats(org.apache.drill.exec.store.hive.HiveMetadataProvider.HiveStats) IOException(java.io.IOException) DrillRuntimeException(org.apache.drill.common.exceptions.DrillRuntimeException) ScanStats(org.apache.drill.exec.physical.base.ScanStats)

Aggregations

ScanStats (org.apache.drill.exec.physical.base.ScanStats)6 IOException (java.io.IOException)2 DrillRuntimeException (org.apache.drill.common.exceptions.DrillRuntimeException)2 DrillCostFactory (org.apache.drill.exec.planner.cost.DrillCostBase.DrillCostFactory)2 CompleteFileWork (org.apache.drill.exec.store.schedule.CompleteFileWork)2 Predicate (com.google.common.base.Predicate)1 MongoClient (com.mongodb.MongoClient)1 MongoDatabase (com.mongodb.client.MongoDatabase)1 ExecutionSetupException (org.apache.drill.common.exceptions.ExecutionSetupException)1 PhysicalOperatorSetupException (org.apache.drill.exec.physical.PhysicalOperatorSetupException)1 HiveStats (org.apache.drill.exec.store.hive.HiveMetadataProvider.HiveStats)1 Document (org.bson.Document)1 BsonTypeClassMap (org.bson.codecs.BsonTypeClassMap)1 DocumentCodec (org.bson.codecs.DocumentCodec)1