@Deprecated // to be removed before 2.0 public ConfigBuilder withInSubqueryThreshold(int inSubQueryThreshold) { return withInSubQueryThreshold(inSubQueryThreshold); }
@Deprecated // to be removed before 2.0 public ConfigBuilder withInSubqueryThreshold(int inSubQueryThreshold) { return withInSubQueryThreshold(inSubQueryThreshold); }
@Deprecated // to be removed before 2.0 public ConfigBuilder withInSubqueryThreshold(int inSubQueryThreshold) { return withInSubQueryThreshold(inSubQueryThreshold); }
.withDecorrelationEnabled(false) .withTrimUnusedFields(false) .withInSubQueryThreshold(Integer.MAX_VALUE) .build(); final FrameworkConfig frameworkConfig = Frameworks
/** * Returns a rel root that defers materialization of scans via {@link com.dremio.exec.planner.logical.ConvertibleScan} * * Used for serialization. */ public RelRootPlus toConvertibleRelRoot(final SqlNode validatedNode, boolean expand) { final OptionManager o = settings.getOptions(); final boolean useLegacyDecorrelator = o.getOption(PlannerSettings.USE_LEGACY_DECORRELATOR); final long inSubQueryThreshold = o.getOption(ExecConstants.FAST_OR_ENABLE) ? o.getOption(ExecConstants.FAST_OR_MAX_THRESHOLD) : settings.getOptions().getOption(ExecConstants.PLANNER_IN_SUBQUERY_THRESHOLD); final SqlToRelConverter.Config config = SqlToRelConverter.configBuilder() .withInSubQueryThreshold((int) inSubQueryThreshold) .withTrimUnusedFields(true) .withConvertTableAccess(false) .withExpand(expand) .build(); final ReflectionAllowedMonitoringConvertletTable convertletTable = new ReflectionAllowedMonitoringConvertletTable(new ConvertletTable(functionContext.getContextInformation())); final SqlToRelConverter sqlToRelConverter = new DremioSqlToRelConverter(this, validator, convertletTable, config); // Previously we had "top" = !innerQuery, but calcite only adds project if it is not a top query. final RelRoot rel = sqlToRelConverter.convertQuery(validatedNode, false /* needs validate */, false /* top */); final RelNode rel2 = sqlToRelConverter.flattenTypes(rel.rel, true); final RelNode rel3; rel3 = expand ? rel2 : rel2.accept(new RelsWithRexSubQueryFlattener(sqlToRelConverter)); final RelNode rel4 = RelDecorrelator.decorrelateQuery(rel3, useLegacyDecorrelator); if (logger.isDebugEnabled()) { logger.debug("ConvertQuery with expand = {}:\n{}", expand, RelOptUtil.toString(rel4, SqlExplainLevel.ALL_ATTRIBUTES)); } return RelRootPlus.of(rel4, rel.kind, convertletTable.isReflectionDisallowed()); }
/** Test case for * <a href="https://issues.apache.org/jira/browse/CALCITE-1321">[CALCITE-1321] * Configurable IN list size when converting IN clause to join</a>. */ @Test public void testInToSemiJoin() { final String sql = "SELECT empno\n" + "FROM emp AS e\n" + "WHERE cast(e.empno as bigint) in (130, 131, 132, 133, 134)"; // No conversion to join since less than IN-list size threshold 10 SqlToRelConverter.Config noConvertConfig = SqlToRelConverter.configBuilder().withInSubQueryThreshold(10).build(); sql(sql).withConfig(noConvertConfig).convertsTo("${planNotConverted}"); // Conversion to join since greater than IN-list size threshold 2 SqlToRelConverter.Config convertConfig = SqlToRelConverter.configBuilder().withInSubQueryThreshold(2).build(); sql(sql).withConfig(convertConfig).convertsTo("${planConverted}"); }
/** Test case for * <a href="https://issues.apache.org/jira/browse/CALCITE-1321">[CALCITE-1321] * Configurable IN list size when converting IN clause to join</a>. */ @Test public void testInToSemiJoin() { final String sql = "SELECT empno\n" + "FROM emp AS e\n" + "WHERE cast(e.empno as bigint) in (130, 131, 132, 133, 134)"; // No conversion to join since less than IN-list size threshold 10 SqlToRelConverter.Config noConvertConfig = SqlToRelConverter.configBuilder().withInSubQueryThreshold(10).build(); sql(sql).withConfig(noConvertConfig).convertsTo("${planNotConverted}"); // Conversion to join since greater than IN-list size threshold 2 SqlToRelConverter.Config convertConfig = SqlToRelConverter.configBuilder().withInSubQueryThreshold(2).build(); sql(sql).withConfig(convertConfig).convertsTo("${planConverted}"); }
@Deprecated // to be removed before 2.0 public ConfigBuilder withInSubqueryThreshold(int inSubQueryThreshold) { return withInSubQueryThreshold(inSubQueryThreshold); }
.withDecorrelationEnabled(false) .withTrimUnusedFields(false) .withInSubQueryThreshold(Integer.MAX_VALUE) .build(); final FrameworkConfig frameworkConfig = Frameworks