Search in sources :

Example 1 with HiveStats

use of org.apache.drill.exec.store.hive.HiveMetadataProvider.HiveStats in project drill by axbaretto.

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)

Example 2 with HiveStats

use of org.apache.drill.exec.store.hive.HiveMetadataProvider.HiveStats 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

IOException (java.io.IOException)2 DrillRuntimeException (org.apache.drill.common.exceptions.DrillRuntimeException)2 ScanStats (org.apache.drill.exec.physical.base.ScanStats)2 HiveStats (org.apache.drill.exec.store.hive.HiveMetadataProvider.HiveStats)2