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 [email protected] or ask anу advice on http://asf.slack.com #ignite channel.

/** Participating columns. */
protected final ImmutableBitSet requiredColumns;
/** Row field to column mapping. */
protected final int[] fieldColMapping;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: it looks bit confusing. Let's rename pameters and fields like this everywhere to something like:
rawToRelColMapping and/or relToRawColMapping

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here we have mapping from node row fields to table row columns. We have identical naming in IndexScan: idxFieldMapping - from index keys to row fields, fieldIdxMapping - from row fields to index keys.
Maybe just extend the javadoc?

* @param nodeRow Relational node row.
* @param fieldColMapping Mapping from node row fields to table row columns. If column is not requried
* corresponding field has -1 mapped value.
* @return Enriched relational node row.
Copy link
Contributor

Choose a reason for hiding this comment

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

If we return a relational row, why the mapping above is from node row to table row. The suggested renaming of fieldColMapping should also help with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Output row fields (node row) is a subset of input row fields (table row), it's faster to iterate over output row mapping, so we have mapping from output to input.

* @param <TableRow>> Raw table row type.
* @param <Row>> Relational node row type.
*/
public interface TableRowIterable<TableRow, Row> extends Iterable<Row> {
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 this new extra interface? Looks like we already have a bunch of scan interfaces and abstract classes. Can it be inside AbstractCacheColumnsScan?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why not? We don't have any scan interfaces except this new one. Interfaces are more flexible, maybe in future we can implement another scan, not inherited from AbstractCacheColumnsScan, with row enrichment (currently system view scans, table function scans and spool scans don't give any benefits with row enriching iterator)

* @param <TableRow>> Raw table row type.
* @param <Row>> Relational node row type.
*/
public interface TableRowIterable<TableRow, Row> extends Iterable<Row> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Naming. If we convert, the name might be smth. like TableRawIterableConverter or TableRowFilterableIterable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we don't convert here

@Vladsz83
Copy link
Contributor

Vladsz83 commented Jan 9, 2026

@alex-plekhanov , could you please merge master?

# Conflicts:
#	modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/AbstractCacheScan.java
#	modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/LogicalRelImplementor.java
#	modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/TableScan.java
#	modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/ProjectableFilterableTableScan.java
#	modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/planner/AbstractPlannerTest.java
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
20 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

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