[GitHub] flink pull request #2926: [FLINK-5226] [table] Use correct DataSetCostFactor...

2016-12-08 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/flink/pull/2926


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request #2926: [FLINK-5226] [table] Use correct DataSetCostFactor...

2016-12-07 Thread fhueske
Github user fhueske commented on a diff in the pull request:

https://github.com/apache/flink/pull/2926#discussion_r91460589
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/nodes/dataset/DataSetCalc.scala
 ---
@@ -73,7 +75,11 @@ class DataSetCalc(
 
 val child = this.getInput
 val rowCnt = metadata.getRowCount(child)
-val exprCnt = calcProgram.getExprCount
+
+// compute number of non-field access expressions (computations, 
conditions, etc.)
+//   we only want to account for computations, not for simple 
projections.
+val exprCnt = 
calcProgram.getExprList.asScala.toList.count(!_.isInstanceOf[RexInputRef])
--- End diff --

Very good point, thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request #2926: [FLINK-5226] [table] Use correct DataSetCostFactor...

2016-12-07 Thread beyond1920
Github user beyond1920 commented on a diff in the pull request:

https://github.com/apache/flink/pull/2926#discussion_r91455098
  
--- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/nodes/dataset/DataSetCalc.scala
 ---
@@ -73,7 +75,11 @@ class DataSetCalc(
 
 val child = this.getInput
 val rowCnt = metadata.getRowCount(child)
-val exprCnt = calcProgram.getExprCount
+
+// compute number of non-field access expressions (computations, 
conditions, etc.)
+//   we only want to account for computations, not for simple 
projections.
+val exprCnt = 
calcProgram.getExprList.asScala.toList.count(!_.isInstanceOf[RexInputRef])
--- End diff --

maybe we could also exclude RexLiteral as well.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] flink pull request #2926: [FLINK-5226] [table] Use correct DataSetCostFactor...

2016-12-02 Thread fhueske
GitHub user fhueske opened a pull request:

https://github.com/apache/flink/pull/2926

[FLINK-5226] [table] Use correct DataSetCostFactory and improve DataSetCalc 
costs.

- Improved DataSetCalc costs make projections cheap and help to push them 
down.
- Adapted existing tests that check optimized plans

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/fhueske/flink tableEagerProject

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/flink/pull/2926.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #2926


commit 11142952016f3777eb3305aead0f83e9271fe736
Author: Fabian Hueske 
Date:   2016-12-02T14:28:16Z

[FLINK-5226] [table] Use correct DataSetCostFactory and improve DataSetCalc 
costs.

- Improved DataSetCalc costs make projections cheap and help to push them 
down.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---