Skip to content

Conversation

@alex-plekhanov
Copy link
Contributor

Thank you for submitting the pull request to the Apache Ignite.

In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • The pull request title is treated as the final commit message.
    The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • A reviewer has been mentioned through the JIRA comments
    (see the Maintainers list)
  • The pull request has been checked by the Teamcity Bot and
    the green visa attached to the JIRA ticket (see TC.Bot: Check PR)

Notes

If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
4 New Code Smells (required ≤ 1)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE


/**
* Creates a ConverterRule.
*/
public TableModifyConverterRule() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion. Creates TableModifySingleNodeConverterRule

}

/** {@inheritDoc} */
@Override protected @Nullable PhysicalNode convert(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial codestyle. Might be a sigle line. Up to you.


switch (rel.getOperation()) {
case MERGE:
// Merge contains insert fields as well as update fields, it's impossible to check input distribution
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial spelling. Lets fix the sentences. Use . instead of ,.


RelDataType type = fields[i + 1] instanceof Class ? TYPE_FACTORY.createJavaType((Class<?>)fields[i + 1]) :
TYPE_FACTORY.createSqlType((SqlTypeName)fields[i + 1]);
TYPE_FACTORY.createTypeWithNullability(TYPE_FACTORY.createSqlType((SqlTypeName)fields[i + 1]), true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion, lets split the lines like:

RelDataType type = fields[i + 1] instanceof Class 
                ? TYPE_FACTORY.createJavaType((Class<?>)fields[i + 1]) 
                : TYPE_FACTORY.createTypeWithNullability(TYPE_FACTORY.createSqlType((SqlTypeName)fields[i + 1]), true);

return null;

switch (rel.getOperation()) {
case MERGE:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have tests for this case?

// Check UPDATE statements.

// partitioned.
assertPlan("UPDATE test SET val = val + 1", schema,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks really too short check. Maybe we need to search for Excnanheg/Aggregates.


// partitioned.
assertPlan("UPDATE test SET val = val + 1", schema,
hasChildThat(isInstanceOf(IgniteTableModify.class).and(hasDistribution(IgniteDistributions.random()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why random(), not hash() ?

* Converts LogicalTableModify to distributed IgniteTableModify (Perform table modify on remote nodes,
* aggregate affected rows count and send result to the initiator node).
*/
public class TableModifyDistributedConverterRule extends AbstractIgniteConverterRule<LogicalTableModify> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if underlying cache has a node filer? Do we need to consider it?

.and(input(isTableScan("TEST_REPL"))));

// broadcast (force distributed).
assertPlan("UPDATE test_repl SET val = val + 1", schema,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it duplicate or corrupt data? Or TrimExchange prevents?


/** Tests that table modify can be executed on remote nodes. */
@Test
public void testDistributedTableModify() throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need tests with filters (WHERE )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants