Skip to content

fields are never queried, why? #648

Open

Description

@github-actions

fields are never queried, why?

https://github.com/apache/incubator-wayang/blob/3fa657bcc8c86198b9532aa06bf27964c3f771be/wayang-api/wayang-api-sql/src/main/java/org/apache/wayang/api/sql/calcite/rel/WayangTableScan.java#L35

import org.apache.calcite.rel.hint.RelHint;
import org.apache.calcite.schema.Table;
import org.apache.wayang.api.sql.calcite.convention.WayangConvention;

import java.util.List;

public class WayangTableScan extends TableScan implements WayangRel {

    //TODO: fields are never queried, why?
    private final int[] fields;

    public WayangTableScan(RelOptCluster cluster,

90ce836ef2aa36c822e4f7f1f1de6f543ddb4e50

Activity

  1. AjayBoddeda4 commented on Mar 17, 2026

    @AjayBoddeda4

    Hi, I am Ajay Boddeda, a GSoC 2026 applicant working on the DataFrames API proposal for Wayang.
    I came across this issue while studying the codebase. This is directly related to the select() operation I am planning to implement in the DataFrame API — where users specify which columns they need and only those should be queried.
    My understanding is that the fields array in WayangTableScan stores the projected column indices, but these are never passed down to the actual query execution. This means even when a user does df.select('name', 'age'), all columns are fetched which is inefficient.
    I would love to investigate this further and potentially contribute a fix. Could anyone guide me on where the fields array should be used in the execution flow?

  2. ekas-7 commented on Oct 30, 2026

    @ekas-7

    @zkaoudi Simple version of this change that will be fix in my humble opnion :

    If the code says "read table customer, columns name and age", we used to send:

    SELECT * FROM customer

    Now we send:

    SELECT name, age FROM customer

    The table name still goes after FROM. Only the SELECT list changed.

    If no columns are given, it is still SELECT *.
    If a name is not a normal column, like ST_AsText(geom), it is still SELECT *.

    I updated the Trino and Presto tests to expect the column list, but I could not run them here. They need a live Trino and Presto.

    Associated PR : #864

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions