You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/05/18 15:21:44 UTC

[GitHub] [incubator-kyuubi] pan3793 opened a new pull request, #2701: [KYUUBI #2539][FOLLOWUP] Kyuubi Spark TPC-DS Connector - SupportsReportStatistics

pan3793 opened a new pull request, #2701:
URL: https://github.com/apache/incubator-kyuubi/pull/2701

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html
     2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   Verify `stats.rowCount` when Spark version >= 3.2
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] cxzl25 commented on a diff in pull request #2701: Kyuubi Spark TPC-DS Connector - Rework SupportsReportStatistics and code refactor

Posted by GitBox <gi...@apache.org>.
cxzl25 commented on code in PR #2701:
URL: https://github.com/apache/incubator-kyuubi/pull/2701#discussion_r877703726


##########
extensions/spark/kyuubi-spark-connector-tpcds/src/test/scala/org/apache/kyuubi/spark/connector/tpcds/TPCDSCatalogSuite.scala:
##########
@@ -65,38 +67,41 @@ class TPCDSCatalogSuite extends KyuubiFunSuite {
     assert(spark.table("tpcds.sf1.web_site").count === 30)
   }
 
-  test("tpcds.sf1 size") {
-    def assertStats(tableName: String, sizeInBytes: BigInt = 1): Unit = {
+  test("tpcds.sf1 stats") {
+    def assertStats(tableName: String, sizeInBytes: BigInt, rowCount: BigInt): Unit = {
       val stats = spark.table(tableName).queryExecution.analyzed.stats
       assert(stats.sizeInBytes == sizeInBytes)
-      // See https://issues.apache.org/jira/browse/SPARK-33954
-      // stats.rowCount only has value in Spark3.2 and above
+      // stats.rowCount only has value after SPARK-33954
+      if (SparkUtils.isSparkVersionAtLeast("3.2")) {
+        assert(stats.rowCount.contains(rowCount), tableName)
+      }
     }
 
-    assertStats("tpcds.sf1.call_center", 1830)
-    assertStats("tpcds.sf1.catalog_page", 1628802)
-    assertStats("tpcds.sf1.catalog_returns", 26560000)
-    assertStats("tpcds.sf1.catalog_sales", 36160000)
-    assertStats("tpcds.sf1.customer", 13200000)
-    assertStats("tpcds.sf1.customer_address", 5500000)
-    assertStats("tpcds.sf1.customer_demographics", 80673600)
-    assertStats("tpcds.sf1.date_dim", 10299909)
-    assertStats("tpcds.sf1.household_demographics", 151200)
-    assertStats("tpcds.sf1.income_band", 320)
-    assertStats("tpcds.sf1.inventory", 187920000)
-    assertStats("tpcds.sf1.item", 5058000)
-    assertStats("tpcds.sf1.promotion", 37200)
-    assertStats("tpcds.sf1.reason", 1330)
-    assertStats("tpcds.sf1.ship_mode", 1120)
-    assertStats("tpcds.sf1.store", 3156)
-    assertStats("tpcds.sf1.store_returns", 32160000)
-    assertStats("tpcds.sf1.store_sales", 39360000)
-    assertStats("tpcds.sf1.time_dim", 5097600)
-    assertStats("tpcds.sf1.warehouse", 585)
-    assertStats("tpcds.sf1.web_page", 5760)
-    assertStats("tpcds.sf1.web_returns", 9720000)
-    assertStats("tpcds.sf1.web_sales", 13560000)
-    assertStats("tpcds.sf1.web_site", 8760)
+    // table *_returns and *_sales have different count in spark.table.count and stats.count

Review Comment:
   Now that count is correct, the comment can be removed.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 commented on pull request #2701: [KYUUBI #2539][FOLLOWUP] Kyuubi Spark TPC-DS Connector - SupportsReportStatistics

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #2701:
URL: https://github.com/apache/incubator-kyuubi/pull/2701#issuecomment-1130158906

   cc @cxzl25 


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] codecov-commenter commented on pull request #2701: [KYUUBI #2539][FOLLOWUP] Kyuubi Spark TPC-DS Connector - SupportsReportStatistics

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #2701:
URL: https://github.com/apache/incubator-kyuubi/pull/2701#issuecomment-1130311660

   # [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/2701?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2701](https://codecov.io/gh/apache/incubator-kyuubi/pull/2701?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7fa35f1) into [master](https://codecov.io/gh/apache/incubator-kyuubi/commit/5585dd01bb91a955c9c28498737b2e245b686ef5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5585dd0) will **decrease** coverage by `0.05%`.
   > The diff coverage is `37.03%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2701      +/-   ##
   ============================================
   - Coverage     64.07%   64.02%   -0.06%     
     Complexity      275      275              
   ============================================
     Files           407      408       +1     
     Lines         19080    19107      +27     
     Branches       2568     2575       +7     
   ============================================
   + Hits          12226    12233       +7     
   - Misses         5704     5720      +16     
   - Partials       1150     1154       +4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-kyuubi/pull/2701?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ache/kyuubi/spark/connector/tpcds/SparkUtils.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2701/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZW5zaW9ucy9zcGFyay9reXV1Ymktc3BhcmstY29ubmVjdG9yLXRwY2RzL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL3NwYXJrL2Nvbm5lY3Rvci90cGNkcy9TcGFya1V0aWxzLnNjYWxh) | `37.03% <37.03%> (ø)` | |
   | [...rg/apache/kyuubi/engine/trino/TrinoStatement.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2701/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS10cmluby1lbmdpbmUvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9reXV1YmkvZW5naW5lL3RyaW5vL1RyaW5vU3RhdGVtZW50LnNjYWxh) | `68.96% <0.00%> (-2.30%)` | :arrow_down: |
   | [...n/scala/org/apache/kyuubi/engine/ProcBuilder.scala](https://codecov.io/gh/apache/incubator-kyuubi/pull/2701/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-a3l1dWJpLXNlcnZlci9zcmMvbWFpbi9zY2FsYS9vcmcvYXBhY2hlL2t5dXViaS9lbmdpbmUvUHJvY0J1aWxkZXIuc2NhbGE=) | `84.27% <0.00%> (-0.63%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/2701?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-kyuubi/pull/2701?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [5585dd0...7fa35f1](https://codecov.io/gh/apache/incubator-kyuubi/pull/2701?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 commented on a diff in pull request #2701: Kyuubi Spark TPC-DS Connector - Rework SupportsReportStatistics and code refactor

Posted by GitBox <gi...@apache.org>.
pan3793 commented on code in PR #2701:
URL: https://github.com/apache/incubator-kyuubi/pull/2701#discussion_r877688824


##########
extensions/spark/kyuubi-spark-connector-tpcds/src/main/scala/org/apache/kyuubi/spark/connector/tpcds/TPCDSSchemaUtils.scala:
##########
@@ -20,51 +20,45 @@ package org.apache.kyuubi.spark.connector.tpcds
 import scala.collection.JavaConverters._
 
 import io.trino.tpcds.Table
+import io.trino.tpcds.Table._
+import io.trino.tpcds.column._
 import io.trino.tpcds.generator._
 
-object TPCDSTableUtils {

Review Comment:
   Split the `TPCDSTableUtils` into `TPCDSSchemaUtils` and `TPCDSStatisticsUtils`, and use ENUM instead of String as much as possible.
   cc @wForget 



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 closed pull request #2701: Kyuubi Spark TPC-DS Connector - Rework SupportsReportStatistics and code refactor

Posted by GitBox <gi...@apache.org>.
pan3793 closed pull request #2701: Kyuubi Spark TPC-DS Connector - Rework SupportsReportStatistics and code refactor
URL: https://github.com/apache/incubator-kyuubi/pull/2701


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] wForget commented on a diff in pull request #2701: Kyuubi Spark TPC-DS Connector - Rework SupportsReportStatistics and code refactor

Posted by GitBox <gi...@apache.org>.
wForget commented on code in PR #2701:
URL: https://github.com/apache/incubator-kyuubi/pull/2701#discussion_r877699073


##########
extensions/spark/kyuubi-spark-connector-tpcds/src/main/scala/org/apache/kyuubi/spark/connector/tpcds/TPCDSSchemaUtils.scala:
##########
@@ -20,51 +20,45 @@ package org.apache.kyuubi.spark.connector.tpcds
 import scala.collection.JavaConverters._
 
 import io.trino.tpcds.Table
+import io.trino.tpcds.Table._
+import io.trino.tpcds.column._
 import io.trino.tpcds.generator._
 
-object TPCDSTableUtils {

Review Comment:
   LGTM



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 commented on a diff in pull request #2701: [KYUUBI #2539][FOLLOWUP] Kyuubi Spark TPC-DS Connector - SupportsReportStatistics

Posted by GitBox <gi...@apache.org>.
pan3793 commented on code in PR #2701:
URL: https://github.com/apache/incubator-kyuubi/pull/2701#discussion_r876157407


##########
extensions/spark/kyuubi-spark-connector-tpcds/src/test/scala/org/apache/kyuubi/spark/connector/tpcds/TPCDSCatalogSuite.scala:
##########
@@ -65,38 +67,41 @@ class TPCDSCatalogSuite extends KyuubiFunSuite {
     assert(spark.table("tpcds.sf1.web_site").count === 30)
   }
 
-  test("tpcds.sf1 size") {
-    def assertStats(tableName: String, sizeInBytes: BigInt = 1): Unit = {
+  test("tpcds.sf1 stats") {
+    def assertStats(tableName: String, sizeInBytes: BigInt, rowCount: BigInt): Unit = {
       val stats = spark.table(tableName).queryExecution.analyzed.stats
       assert(stats.sizeInBytes == sizeInBytes)
-      // See https://issues.apache.org/jira/browse/SPARK-33954
-      // stats.rowCount only has value in Spark3.2 and above
+      // stats.rowCount only has value after SPARK-33954
+      if (SparkUtils.isSparkVersionAtLeast("3.2")) {
+        assert(stats.rowCount.contains(rowCount), tableName)
+      }
     }
 
-    assertStats("tpcds.sf1.call_center", 1830)
-    assertStats("tpcds.sf1.catalog_page", 1628802)
-    assertStats("tpcds.sf1.catalog_returns", 26560000)
-    assertStats("tpcds.sf1.catalog_sales", 36160000)
-    assertStats("tpcds.sf1.customer", 13200000)
-    assertStats("tpcds.sf1.customer_address", 5500000)
-    assertStats("tpcds.sf1.customer_demographics", 80673600)
-    assertStats("tpcds.sf1.date_dim", 10299909)
-    assertStats("tpcds.sf1.household_demographics", 151200)
-    assertStats("tpcds.sf1.income_band", 320)
-    assertStats("tpcds.sf1.inventory", 187920000)
-    assertStats("tpcds.sf1.item", 5058000)
-    assertStats("tpcds.sf1.promotion", 37200)
-    assertStats("tpcds.sf1.reason", 1330)
-    assertStats("tpcds.sf1.ship_mode", 1120)
-    assertStats("tpcds.sf1.store", 3156)
-    assertStats("tpcds.sf1.store_returns", 32160000)
-    assertStats("tpcds.sf1.store_sales", 39360000)
-    assertStats("tpcds.sf1.time_dim", 5097600)
-    assertStats("tpcds.sf1.warehouse", 585)
-    assertStats("tpcds.sf1.web_page", 5760)
-    assertStats("tpcds.sf1.web_returns", 9720000)
-    assertStats("tpcds.sf1.web_sales", 13560000)
-    assertStats("tpcds.sf1.web_site", 8760)
+    // table *_returns and *_sales have different count in spark.table.count and stats.count
+    assertStats("tpcds.sf1.call_center", 1830, 6)
+    assertStats("tpcds.sf1.catalog_page", 1628802, 11718)
+    assertStats("tpcds.sf1.catalog_returns", 26560000, 160000)
+    assertStats("tpcds.sf1.catalog_sales", 36160000, 160000)
+    assertStats("tpcds.sf1.customer", 13200000, 100000)
+    assertStats("tpcds.sf1.customer_address", 5500000, 50000)
+    assertStats("tpcds.sf1.customer_demographics", 80673600, 1920800)
+    assertStats("tpcds.sf1.date_dim", 10299909, 73049)
+    assertStats("tpcds.sf1.household_demographics", 151200, 7200)
+    assertStats("tpcds.sf1.income_band", 320, 20)
+    assertStats("tpcds.sf1.inventory", 187920000, 11745000)
+    assertStats("tpcds.sf1.item", 5058000, 18000)
+    assertStats("tpcds.sf1.promotion", 37200, 300)
+    assertStats("tpcds.sf1.reason", 1330, 35)
+    assertStats("tpcds.sf1.ship_mode", 1120, 20)
+    assertStats("tpcds.sf1.store", 3156, 12)
+    assertStats("tpcds.sf1.store_returns", 32160000, 240000)
+    assertStats("tpcds.sf1.store_sales", 39360000, 240000)
+    assertStats("tpcds.sf1.time_dim", 5097600, 86400)
+    assertStats("tpcds.sf1.warehouse", 585, 5)
+    assertStats("tpcds.sf1.web_page", 5760, 60)
+    assertStats("tpcds.sf1.web_returns", 9720000, 60000)
+    assertStats("tpcds.sf1.web_sales", 13560000, 60000)

Review Comment:
   The diff looks unreasonable...



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [incubator-kyuubi] pan3793 commented on pull request #2701: Kyuubi Spark TPC-DS Connector - Rework SupportsReportStatistics and code refactor

Posted by GitBox <gi...@apache.org>.
pan3793 commented on PR #2701:
URL: https://github.com/apache/incubator-kyuubi/pull/2701#issuecomment-1132432304

   Thanks @cxzl25 and @wForget for review, merging to master


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org