Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-4018

EnumerableValues should provide requested traits

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.24.0
    • core
    • None

    Description

      Only passThrough is needed.
      Currently, when Values is created, it will enumerate all the possible collations no matter parent operator requires it or not, it will be a disaster if the Values has thousands of columns, and the parent operator may be just a hash aggregate or hashjoin, which doesn't care about its collation.
      The collation should be created on demand by calling passThrough.

      e.g.

      SELECT * from (values
      (1, 1),
      (2, 1),
      (1, 2),
      (2, 2)
      ) as t(a, b)
      order by b, a
      

      Currently Calcite will generate plan:

      EnumerableSort(sort0=[$1], sort1=[$0], dir0=[ASC], dir1=[ASC])
        EnumerableValues(tuples=[[{ 1, 1 }, { 2, 1 }, { 1, 2 }, { 2, 2 }]])
      

      But after this JIRA, I am expecting a plan without Sort.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            hyuan Haisheng Yuan
            hyuan Haisheng Yuan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 20m
                1h 20m

                Slack

                  Issue deployment