This is an automated email from the ASF dual-hosted git repository. ibzib pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push: new c046d7f [BEAM-12009] Enable Calc splitting rule by default. new def1ea6 Merge pull request #14655 from ibzib/enable-calc-splitting c046d7f is described below commit c046d7fff3746d7431d6fed09526b365cfd0d9a1 Author: Kyle Weaver <kcwea...@google.com> AuthorDate: Tue Apr 27 13:43:15 2021 -0700 [BEAM-12009] Enable Calc splitting rule by default. --- .../sdk/extensions/sql/zetasql/ZetaSQLQueryPlanner.java | 3 +-- .../sdk/extensions/sql/zetasql/ZetaSqlJavaUdfTest.java | 15 --------------- .../extensions/sql/zetasql/ZetaSqlJavaUdfTypeTest.java | 12 +----------- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSQLQueryPlanner.java b/sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSQLQueryPlanner.java index 918f7ce..fb90a26 100644 --- a/sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSQLQueryPlanner.java +++ b/sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSQLQueryPlanner.java @@ -75,10 +75,9 @@ import org.slf4j.LoggerFactory; "nullness" // TODO(https://issues.apache.org/jira/browse/BEAM-10402) }) public class ZetaSQLQueryPlanner implements QueryPlanner { - // TODO(BEAM-11747) Re-enable BeamJavaUdfCalcRule by default when it is safe to do so. public static final Collection<RelOptRule> DEFAULT_CALC = ImmutableList.<RelOptRule>builder() - .add(BeamZetaSqlCalcRule.INSTANCE, BeamZetaSqlCalcMergeRule.INSTANCE) + .add(BeamZetaSqlCalcSplittingRule.INSTANCE, BeamZetaSqlCalcMergeRule.INSTANCE) .build(); private static final Logger LOG = LoggerFactory.getLogger(ZetaSQLQueryPlanner.class); diff --git a/sdks/java/extensions/sql/zetasql/src/test/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlJavaUdfTest.java b/sdks/java/extensions/sql/zetasql/src/test/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlJavaUdfTest.java index 22b18f9..57b5f4c 100644 --- a/sdks/java/extensions/sql/zetasql/src/test/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlJavaUdfTest.java +++ b/sdks/java/extensions/sql/zetasql/src/test/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlJavaUdfTest.java @@ -42,14 +42,11 @@ import org.apache.beam.sdk.transforms.Sum; import org.apache.beam.sdk.values.PCollection; import org.apache.beam.sdk.values.Row; import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.tools.Frameworks; -import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.tools.RuleSet; -import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap; import org.checkerframework.checker.nullness.qual.Nullable; import org.codehaus.commons.compiler.CompileException; import org.joda.time.Duration; import org.junit.Before; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; @@ -88,15 +85,6 @@ public class ZetaSqlJavaUdfTest extends ZetaSqlTestBase { emptyJarPathProperty, ZetaSqlJavaUdfTest.class.getSimpleName())); } initialize(); - - // Add BeamZetaSqlCalcSplittingRule to planner to enable UDFs. - this.config = - Frameworks.newConfigBuilder(config) - .ruleSets( - ZetaSQLQueryPlanner.getZetaSqlRuleSets( - ImmutableList.of(BeamZetaSqlCalcSplittingRule.INSTANCE)) - .toArray(new RuleSet[0])) - .build(); } @Test @@ -221,9 +209,6 @@ public class ZetaSqlJavaUdfTest extends ZetaSqlTestBase { } @Test - @Ignore( - "Re-enable when ZetaSQLQueryPlanner has UDFs enabled by default. " - + "Until then, this test fails because we can't pass a ZetaSQLQueryPlanner instance to SqlTransform.") public void testSqlTransformRegisterUdf() { String sql = "SELECT increment(0);"; PCollection<Row> stream = diff --git a/sdks/java/extensions/sql/zetasql/src/test/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlJavaUdfTypeTest.java b/sdks/java/extensions/sql/zetasql/src/test/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlJavaUdfTypeTest.java index 1481fc80..498e1b8 100644 --- a/sdks/java/extensions/sql/zetasql/src/test/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlJavaUdfTypeTest.java +++ b/sdks/java/extensions/sql/zetasql/src/test/java/org/apache/beam/sdk/extensions/sql/zetasql/ZetaSqlJavaUdfTypeTest.java @@ -33,8 +33,6 @@ import org.apache.beam.sdk.values.PCollection; import org.apache.beam.sdk.values.Row; import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.schema.SchemaPlus; import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.tools.Frameworks; -import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.tools.RuleSet; -import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableMap; import org.joda.time.Duration; import org.junit.Before; @@ -128,15 +126,7 @@ public class ZetaSqlJavaUdfTypeTest extends ZetaSqlTestBase { "test_float64", ScalarFunctionImpl.create(DoubleIdentityFn.class.getMethod("eval", Double.class))); - this.config = - Frameworks.newConfigBuilder(config) - .defaultSchema(schema) - // Add BeamZetaSqlCalcSplittingRule to planner to enable UDFs. - .ruleSets( - ZetaSQLQueryPlanner.getZetaSqlRuleSets( - ImmutableList.of(BeamZetaSqlCalcSplittingRule.INSTANCE)) - .toArray(new RuleSet[0])) - .build(); + this.config = Frameworks.newConfigBuilder(config).defaultSchema(schema).build(); } public static class BooleanIdentityFn implements BeamSqlUdf {