You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "AMashenkov (via GitHub)" <gi...@apache.org> on 2023/07/27 15:03:11 UTC
[GitHub] [ignite-3] AMashenkov opened a new pull request, #2372: IGNITE-18875 Sql. Drop AbstractPlannerTest.TestTable.
AMashenkov opened a new pull request, #2372:
URL: https://github.com/apache/ignite-3/pull/2372
https://issues.apache.org/jira/browse/IGNITE-18875
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] AMashenkov merged pull request #2372: IGNITE-18875 Sql. Drop AbstractPlannerTest.TestTable.
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov merged PR #2372:
URL: https://github.com/apache/ignite-3/pull/2372
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] korlov42 commented on a diff in pull request #2372: IGNITE-18875 Sql. Drop AbstractPlannerTest.TestTable.
Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 commented on code in PR #2372:
URL: https://github.com/apache/ignite-3/pull/2372#discussion_r1280189438
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestBuilders.java:
##########
@@ -138,6 +138,8 @@ public interface TableBuilder extends TableBuilderBase<TableBuilder> {
/** Returns a builder of the test hash-index object. */
public HashIndexBuilder hashIndex();
+ TableBuilder colocationGroup(ColocationGroup colocationGroup);
Review Comment:
why do we need colocation group in TableBuilder? I mean, TableBuilder is meant to build table for planner tests, they don't need colocation group to be provided
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/CorrelatedNestedLoopJoinPlannerTest.java:
##########
@@ -112,51 +83,29 @@ public IgniteDistribution distribution() {
*/
@Test
public void testInvalidIndexExpressions() throws Exception {
- IgniteSchema publicSchema = new IgniteSchema("PUBLIC");
- IgniteTypeFactory f = Commons.typeFactory();
-
- publicSchema.addTable(
- new TestTable(
- new RelDataTypeFactory.Builder(f)
- .add("ID", f.createJavaType(Integer.class))
- .add("JID", f.createJavaType(Integer.class))
- .add("VAL", f.createJavaType(String.class))
- .build(), "T0") {
-
- @Override
- public IgniteDistribution distribution() {
- return IgniteDistributions.broadcast();
- }
- }
- .addIndex("t0_jid_idx", 1, 0)
- );
-
- publicSchema.addTable(
- new TestTable(
- new RelDataTypeFactory.Builder(f)
- .add("ID", f.createJavaType(Integer.class))
- .add("JID", f.createJavaType(Integer.class))
- .add("VAL", f.createJavaType(String.class))
- .build(), "T1") {
-
- @Override
- public IgniteDistribution distribution() {
- return IgniteDistributions.broadcast();
- }
- }
- .addIndex("t1_jid_idx", 1, 0)
+ IgniteSchema publicSchema = createSchemaFrom(
+ tableA("T0").andThen(addHashIndex("JID", "ID")),
Review Comment:
> tableA("T0").andThen(addHashIndex("JID", "ID"))
This notation looks cool!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2372: IGNITE-18875 Sql. Drop AbstractPlannerTest.TestTable.
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2372:
URL: https://github.com/apache/ignite-3/pull/2372#discussion_r1279278045
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestStatistic.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.framework;
+
+import java.util.Collections;
+import java.util.List;
+import org.apache.calcite.rel.RelCollation;
+import org.apache.calcite.rel.RelDistribution;
+import org.apache.calcite.rel.RelReferentialConstraint;
+import org.apache.calcite.schema.Statistic;
+import org.apache.calcite.util.ImmutableBitSet;
+
+/**
+ * A test statistic that implements all the necessary for the optimizer methods to be used to prepare a query.
+ */
+public class TestStatistic implements Statistic {
Review Comment:
Because I would like to omit any logic, production implementation either require MinRows supplier in constructor, or will implicitly use MIN_ROW=10_000 hardcoded constant.
```
public final Double getRowCount() {
double localRowCnt = rowCountSupplier.getAsDouble();
// Forbid zero result, to prevent zero cost for table and index scans.
double minRows = this.minRows.getAsDouble();
return Math.max(minRows, localRowCnt);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2372: IGNITE-18875 Sql. Drop AbstractPlannerTest.TestTable.
Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2372:
URL: https://github.com/apache/ignite-3/pull/2372#discussion_r1279278045
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestStatistic.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.framework;
+
+import java.util.Collections;
+import java.util.List;
+import org.apache.calcite.rel.RelCollation;
+import org.apache.calcite.rel.RelDistribution;
+import org.apache.calcite.rel.RelReferentialConstraint;
+import org.apache.calcite.schema.Statistic;
+import org.apache.calcite.util.ImmutableBitSet;
+
+/**
+ * A test statistic that implements all the necessary for the optimizer methods to be used to prepare a query.
+ */
+public class TestStatistic implements Statistic {
Review Comment:
Because I would like to omit any logic, production implementation either require MinRows supplier in constructor, or will implicitly use MIN_ROW=10_000 hardcoded constant.
```
public final Double getRowCount() {
double localRowCnt = rowCountSupplier.getAsDouble();
// Forbid zero result, to prevent zero cost for table and index scans.
double minRows = this.minRows.getAsDouble();
return Math.max(minRows, localRowCnt);
}
```
So, using prod implementation, I must take it's guarantees into account, but in most of planner tests, I don't want to care of it.
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestStatistic.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.framework;
+
+import java.util.Collections;
+import java.util.List;
+import org.apache.calcite.rel.RelCollation;
+import org.apache.calcite.rel.RelDistribution;
+import org.apache.calcite.rel.RelReferentialConstraint;
+import org.apache.calcite.schema.Statistic;
+import org.apache.calcite.util.ImmutableBitSet;
+
+/**
+ * A test statistic that implements all the necessary for the optimizer methods to be used to prepare a query.
+ */
+public class TestStatistic implements Statistic {
Review Comment:
Because I would like to omit any logic, production implementation either require MinRows supplier in constructor, or will implicitly use MIN_ROW=10_000 hardcoded constant.
```
public final Double getRowCount() {
double localRowCnt = rowCountSupplier.getAsDouble();
// Forbid zero result, to prevent zero cost for table and index scans.
double minRows = this.minRows.getAsDouble();
return Math.max(minRows, localRowCnt);
}
```
So, using prod implementation, I must take it's guarantees into account, but in most of planner tests, I don't want to care of it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] lowka commented on a diff in pull request #2372: IGNITE-18875 Sql. Drop AbstractPlannerTest.TestTable.
Posted by "lowka (via GitHub)" <gi...@apache.org>.
lowka commented on code in PR #2372:
URL: https://github.com/apache/ignite-3/pull/2372#discussion_r1279110411
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestStatistic.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.framework;
+
+import java.util.Collections;
+import java.util.List;
+import org.apache.calcite.rel.RelCollation;
+import org.apache.calcite.rel.RelDistribution;
+import org.apache.calcite.rel.RelReferentialConstraint;
+import org.apache.calcite.schema.Statistic;
+import org.apache.calcite.util.ImmutableBitSet;
+
+/**
+ * A test statistic that implements all the necessary for the optimizer methods to be used to prepare a query.
+ */
+public class TestStatistic implements Statistic {
Review Comment:
IgniteStatistics only requires Distribution but it is accessible in constructor of TestTable via TableDescriptor.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [ignite-3] lowka commented on a diff in pull request #2372: IGNITE-18875 Sql. Drop AbstractPlannerTest.TestTable.
Posted by "lowka (via GitHub)" <gi...@apache.org>.
lowka commented on code in PR #2372:
URL: https://github.com/apache/ignite-3/pull/2372#discussion_r1279108987
##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestStatistic.java:
##########
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.sql.engine.framework;
+
+import java.util.Collections;
+import java.util.List;
+import org.apache.calcite.rel.RelCollation;
+import org.apache.calcite.rel.RelDistribution;
+import org.apache.calcite.rel.RelReferentialConstraint;
+import org.apache.calcite.schema.Statistic;
+import org.apache.calcite.util.ImmutableBitSet;
+
+/**
+ * A test statistic that implements all the necessary for the optimizer methods to be used to prepare a query.
+ */
+public class TestStatistic implements Statistic {
Review Comment:
Why not to use the same Statistics object as production code?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org