You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "comphead (via GitHub)" <gi...@apache.org> on 2024/03/05 16:03:07 UTC

[PR] Reduce casts for LEAD/LAG [arrow-datafusion]

comphead opened a new pull request, #9468:
URL: https://github.com/apache/arrow-datafusion/pull/9468

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #.
   
   ## Rationale for this change
   Reduce number of unnecessary casts from `i64` to `usize` and vice versa
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   ## What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   ## Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   ## Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Reduce casts for LEAD/LAG [arrow-datafusion]

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #9468:
URL: https://github.com/apache/arrow-datafusion/pull/9468#discussion_r1513090319


##########
datafusion/sqllogictest/test_files/limit.slt:
##########
@@ -389,18 +389,18 @@ SELECT ROW_NUMBER() OVER (PARTITION BY t1.column1) FROM t t1, t t2, t t3;
 
 # verify that there are multiple partitions in the input (i.e. MemoryExec says
 # there are 4 partitions) so that this tests multi-partition limit.
-query TT
-EXPLAIN SELECT DISTINCT i FROM t1000;
-----
-logical_plan
-Aggregate: groupBy=[[t1000.i]], aggr=[[]]
---TableScan: t1000 projection=[i]
-physical_plan
-AggregateExec: mode=FinalPartitioned, gby=[i@0 as i], aggr=[]
---CoalesceBatchesExec: target_batch_size=8192
-----RepartitionExec: partitioning=Hash([i@0], 4), input_partitions=4
-------AggregateExec: mode=Partial, gby=[i@0 as i], aggr=[]
---------MemoryExec: partitions=4, partition_sizes=[1, 2, 1, 1]
+#query TT

Review Comment:
   This test is failing on my local, not sure if its my PR, as there is no window in the plan



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Reduce casts for LEAD/LAG [arrow-datafusion]

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #9468:
URL: https://github.com/apache/arrow-datafusion/pull/9468#discussion_r1513150694


##########
datafusion/sqllogictest/test_files/limit.slt:
##########
@@ -400,7 +400,7 @@ AggregateExec: mode=FinalPartitioned, gby=[i@0 as i], aggr=[]
 --CoalesceBatchesExec: target_batch_size=8192
 ----RepartitionExec: partitioning=Hash([i@0], 4), input_partitions=4
 ------AggregateExec: mode=Partial, gby=[i@0 as i], aggr=[]
---------MemoryExec: partitions=4, partition_sizes=[1, 2, 1, 1]
+--------MemoryExec: partitions=4, partition_sizes=[1, 1, 2, 1]

Review Comment:
   I dont see how the PR can affect the partition size distribution as the test plan doesn't have window. More likely the test is odd 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Reduce casts for LEAD/LAG [arrow-datafusion]

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #9468:
URL: https://github.com/apache/arrow-datafusion/pull/9468#discussion_r1513203480


##########
datafusion/sqllogictest/test_files/limit.slt:
##########
@@ -389,18 +389,18 @@ SELECT ROW_NUMBER() OVER (PARTITION BY t1.column1) FROM t t1, t t2, t t3;
 
 # verify that there are multiple partitions in the input (i.e. MemoryExec says
 # there are 4 partitions) so that this tests multi-partition limit.
-query TT
-EXPLAIN SELECT DISTINCT i FROM t1000;
-----
-logical_plan
-Aggregate: groupBy=[[t1000.i]], aggr=[[]]
---TableScan: t1000 projection=[i]
-physical_plan
-AggregateExec: mode=FinalPartitioned, gby=[i@0 as i], aggr=[]
---CoalesceBatchesExec: target_batch_size=8192
-----RepartitionExec: partitioning=Hash([i@0], 4), input_partitions=4
-------AggregateExec: mode=Partial, gby=[i@0 as i], aggr=[]
---------MemoryExec: partitions=4, partition_sizes=[1, 2, 1, 1]
+#query TT

Review Comment:
   https://github.com/apache/arrow-datafusion/issues/9450



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Reduce casts for LEAD/LAG [arrow-datafusion]

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead commented on code in PR #9468:
URL: https://github.com/apache/arrow-datafusion/pull/9468#discussion_r1513203770


##########
datafusion/sqllogictest/test_files/limit.slt:
##########
@@ -400,7 +400,7 @@ AggregateExec: mode=FinalPartitioned, gby=[i@0 as i], aggr=[]
 --CoalesceBatchesExec: target_batch_size=8192
 ----RepartitionExec: partitioning=Hash([i@0], 4), input_partitions=4
 ------AggregateExec: mode=Partial, gby=[i@0 as i], aggr=[]
---------MemoryExec: partitions=4, partition_sizes=[1, 2, 1, 1]
+--------MemoryExec: partitions=4, partition_sizes=[1, 1, 2, 1]

Review Comment:
   https://github.com/apache/arrow-datafusion/issues/9450



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Reduce casts for LEAD/LAG [arrow-datafusion]

Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead merged PR #9468:
URL: https://github.com/apache/arrow-datafusion/pull/9468


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org