@Override public OptionValue load(String key) { return delegate.getOption(key); } });
private StatsEstimationParameters getStatsParams() { return new StatsEstimationParameters( options.getOption(HivePluginOptions.HIVE_USE_STATS_IN_METASTORE), (int) options.getOption(ExecConstants.BATCH_LIST_SIZE_ESTIMATE), (int) options.getOption(ExecConstants.BATCH_VARIABLE_FIELD_SIZE_ESTIMATE) ); }
@Override public OptionValue getOption(final String name) { final OptionValue value = getLocalOption(name); if (value == null && fallback != null) { return fallback.getOption(name); } else { return value; } }
@Override public long spillSweepThreshold() { return options().getOption(ExecConstants.SPILL_SWEEP_THRESHOLD); } }
public static Prel insertLocalExchanges(Prel prel, OptionManager options) { final boolean isMuxEnabled = options.getOption(PlannerSettings.MUX_EXCHANGE); final boolean isDeMuxEnabled = options.getOption(PlannerSettings.DEMUX_EXCHANGE); if (isMuxEnabled || isDeMuxEnabled) { return prel.accept(new InsertLocalExchangeVisitor(isMuxEnabled, isDeMuxEnabled), null); } return prel; }
@Override public double getMaxWidthFactor() { final OptionManager options = bitContext.getOptionManager(); final double loadCutoff = options.getOption(ExecConstants.LOAD_CUT_OFF); final double loadReduction = options.getOption(ExecConstants.LOAD_REDUCTION); float clusterLoad = getClusterLoad(); if (clusterLoad < loadCutoff) { return 1.0; // no reduction when load is below load.cut_off } return Math.max(0, 1.0 - clusterLoad * loadReduction); }
public double getMinimumCostPerSplit(SourceType sourceType) { if (SOURCES_WITH_MIN_COST.contains(sourceType.value().toLowerCase())) { OptionValue value = options.getOption(String.format("planner.%s.min_cost_per_split", sourceType.value().toLowerCase())); if (value != null) { return value.getFloatVal(); } } return options.getOption(DEFAULT_SCAN_MIN_COST); }
public long getSliceTarget(){ long sliceTarget = options.getOption(ExecConstants.SLICE_TARGET).getNumVal(); if (isLeafLimitsEnabled() && minimumSampleSize > 0) { return Math.min(sliceTarget, minimumSampleSize); } return sliceTarget; }
DirectBuilder(String sql, SqlNode sqlNode, boolean prepare) { this.sqlNode = sqlNode; this.prepare = prepare; this.sql = sql; final StoreQueryResultsPolicy storeQueryResultsPolicy = Optional .ofNullable(context.getOptions().getOption(STORE_QUERY_RESULTS.getOptionName())) .map(o -> StoreQueryResultsPolicy.valueOf(o.getStringVal().toUpperCase(Locale.ROOT))) .orElse(StoreQueryResultsPolicy.NO); this.storeResults = storeQueryResultsPolicy != StoreQueryResultsPolicy.NO; }
private ReAttemptHandler newExternalAttemptHandler(OptionManager options) { if (options.getOption(ExecConstants.ENABLE_REATTEMPTS)) { return new ExternalAttemptHandler(options); } else { return new NoReAttemptHandler(); } }
private boolean shouldCompact(ReflectionEntry entry, Refresh refresh) { final long medianFileSize = refresh.getMetrics().getMedianFileSize(); final int numFiles = refresh.getMetrics().getNumFiles(); logger.debug("Reflection {} refresh wrote {} files with a median size of {} bytes", getId(entry), numFiles, medianFileSize); return numFiles > optionManager.getOption(COMPACTION_TRIGGER_NUMBER_FILES) && medianFileSize < optionManager.getOption(COMPACTION_TRIGGER_FILE_SIZE)*1024*1024; }
public JsonRecordWriter(OperatorContext context, EasyWriter writer, JSONFormatConfig formatConfig){ final FragmentHandle handle = context.getFragmentHandle(); final String fragmentId = String.format("%d_%d", handle.getMajorFragmentId(), handle.getMinorFragmentId()); this.conf = new Configuration(writer.getFsConf()); this.stats = context.getStats(); this.location = writer.getLocation(); this.prefix = fragmentId; this.useExtendedOutput = context.getOptions().getOption(ExecConstants.JSON_EXTENDED_TYPES); this.extension = formatConfig.outputExtension; this.useExtendedOutput = context.getOptions().getOption(ExecConstants.JSON_EXTENDED_TYPES); this.uglify = !formatConfig.prettyPrint || context.getOptions().getOption(ExecConstants.JSON_WRITER_UGLIFY); }
@Override public TerminalOperator create(TunnelProvider tunnelProvider, OperatorContext context, HashPartitionSender operator) throws ExecutionSetupException { if (context.getOptions().getOption(ExecConstants.ENABLE_VECTORIZED_PARTITIONER)) { return new VectorizedPartitionSenderOperator(context, tunnelProvider, operator); } else { return new PartitionSenderOperator(context, tunnelProvider, operator); } } }
public static void checkDecimalTypeEnabled(OptionManager options) { if (options.getOption(PlannerSettings.ENABLE_DECIMAL_DATA_TYPE_KEY).getBoolVal() == false) { throw UserException.unsupportedError() .message(ExecErrorConstants.DECIMAL_DISABLE_ERR_MSG) .build(logger); } }
@Before public void setUp() { optionManager = mock(OptionManager.class); when(optionManager.getOption("planner.timeout_per_phase_ms")).thenReturn(OptionValue.createLong(OptionType.QUERY, "planner.timeout_per_phase_ms", 100)); settings = new PlannerSettings(DremioTest.DEFAULT_SABOT_CONFIG, optionManager, null); }
public ProjectOperator(final OperatorContext context, final Project config) throws OutOfMemoryException { this.config = config; this.context = context; this.projectorOptions = new ExpressionEvaluationOptions(context.getOptions()); this.projectorOptions.setCodeGenOption(context.getOptions().getOption(ExecConstants.QUERY_EXEC_OPTION.getOptionName()).getStringVal()); this.outgoing = context.createOutputVectorContainer(); }
public FilterOperator(Filter pop, OperatorContext context) throws OutOfMemoryException { this.config = pop; this.context = context; this.filterOptions = new ExpressionEvaluationOptions(context.getOptions()); this.filterOptions.setCodeGenOption(context.getOptions().getOption(ExecConstants.QUERY_EXEC_OPTION.getOptionName()).getStringVal()); this.output = context.createOutputVectorContainerWithSV(); }
public AutoCloseable with(final LongValidator validator, final long value){ final long oldValue = testContext.getOptions().getOption(validator); testContext.getOptions().setOption(OptionValue.createLong(OptionType.SYSTEM, validator.getOptionName(), value)); return new AutoCloseable(){ @Override public void close() throws Exception { testContext.getOptions().setOption(OptionValue.createLong(OptionType.SYSTEM, validator.getOptionName(), oldValue)); }}; }
public AutoCloseable with(final BooleanValidator validator, final boolean value){ final boolean oldValue = testContext.getOptions().getOption(validator); testContext.getOptions().setOption(OptionValue.createBoolean(OptionType.SYSTEM, validator.getOptionName(), value)); return new AutoCloseable(){ @Override public void close() throws Exception { testContext.getOptions().setOption(OptionValue.createBoolean(OptionType.SYSTEM, validator.getOptionName(), oldValue)); }}; }
@Override public VectorAccessible setup(VectorAccessible accessible) throws Exception { state.is(State.NEEDS_SETUP); this.incoming = accessible; this.pivot = createPivot(); this.accumulator = AccumulatorBuilderNoSpill.getAccumulator(context.getAllocator(), context.getClassProducer(), popConfig.getAggrExprs(), incoming, outgoing); this.outgoing.buildSchema(); this.table = new LBlockHashTableNoSpill(HashConfig.getDefault(), pivot, context.getAllocator(), (int)context.getOptions().getOption(ExecConstants.MIN_HASH_TABLE_SIZE), INITIAL_VAR_FIELD_AVERAGE_SIZE, accumulator); state = State.CAN_CONSUME; return outgoing; }