[IGNITE-18225] Sql. Pushdown MODIFY to data node.#1798
[IGNITE-18225] Sql. Pushdown MODIFY to data node.#1798AMashenkov merged 47 commits intoapache:mainfrom
Conversation
dcb9ffe to
b030575
Compare
Add planner tests. singly distributed table case handling.
Add planner tests.
Remove dead code. Add condition in default value supplier.
check style.
use gen_random_uuid instead of generate_implicit_pk.
fix check style.
disable several test cases in ItTabkeRaftSnapshotTest.
disable several test cases in ItTabkeRaftSnapshotTest.
disable several test cases in ItTabkeRaftSnapshotTest.
disable several test cases in ItTabkeRaftSnapshotTest.
disable several test cases in ItIgniteNodeRestartTest.
remove debug flag.
check style fixes.
Add ticket links.
revert changes that allow specifying nullary function calls in DEFAULT values for columns.
add tickets. cleanup.
...c/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java
Outdated
Show resolved
Hide resolved
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/AsyncSqlCursorImpl.java
Show resolved
Hide resolved
| int aggCallCnt = rowType.getFieldCount(); | ||
| List<AggregateCall> aggCalls = new ArrayList<>(); | ||
|
|
||
| for (int i = 0; i < aggCallCnt; i++) { |
There was a problem hiding this comment.
This doesn't look reliable. For now it works just because ModifyNode returns exactly one column, but one of the possible changes is support for RETURNING clause (see this for details). With this in mind, I definitely would not take SUM over an arbitrary column
There was a problem hiding this comment.
@korlov42 Could you please point me how the RETURNING clause can be specified, since at the moment there is no support for RETURNING clause in neither Parser nor RelNodes (TableModify). I am 100% sure about the parser part, because it fails when you add a RETURNING clause.
If is there a ticket for RETURNING clause, I would add a link to it here.
...ngine/src/main/java/org/apache/ignite/internal/sql/engine/rule/TableModifyConverterRule.java
Outdated
Show resolved
Hide resolved
...ngine/src/main/java/org/apache/ignite/internal/sql/engine/rule/TableModifyConverterRule.java
Show resolved
Hide resolved
|
|
||
| RelDataType rowType = tableModify.getRowType(); | ||
| RelDataTypeFactory typeFactory = cluster.getTypeFactory(); | ||
| RelDataType sumType = typeFactory.createTypeWithNullability(typeFactory.createSqlType(SqlTypeName.DECIMAL), true); |
There was a problem hiding this comment.
it's better to use org.apache.calcite.rel.type.RelDataTypeSystem#deriveSumType to derive type of a SUM aggregate
There was a problem hiding this comment.
@korlov42 This is not possible to use org.apache.calcite.rel.type.RelDataTypeSystem#deriveSumType since this method is going to derive an incorrect type and that is going to cause a type difference assertion to fire.
I am going to add a comment that clarifies this.
| */ | ||
| @Test | ||
| public void testInsertIntoSingleDistributedTable() throws Exception { | ||
| IgniteTable test1 = createTable("TEST1", IgniteDistributions.single(), "C1", Integer.class, "C2", Integer.class); |
There was a problem hiding this comment.
Please use TestBuilder framework to create test tables
...s/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/planner/DmlPlannerTest.java
Show resolved
Hide resolved
update planner tests.
use existing types in table modify converter rule.
fix check style.
fix check style.
Fix exception cause handling in AsyncCursor.
add timeouts.
fix error message.
fix comments.
check style.
# Conflicts: # modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItIgniteNodeRestartTest.java
fix ticket link.
fix ticket links.
| DefaultValueStrategy.DEFAULT_COMPUTED, | ||
| () -> UUID.randomUUID().toString() | ||
| () -> { | ||
| throw new AssertionError("Implicit primary key is generated by a function"); |
There was a problem hiding this comment.
| throw new AssertionError("Implicit primary key is generated by a function"); | |
| throw new AssertionError("Implicit primary key is generated by the function"); |
No description provided.