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/01 07:28:33 UTC

[GitHub] [incubator-kyuubi] pan3793 commented on a diff in pull request #2531: DSv2-based Kyuubi Spark TPC-DS Connector

pan3793 commented on code in PR #2531:
URL: https://github.com/apache/incubator-kyuubi/pull/2531#discussion_r862435404


##########
extensions/spark/kyuubi-spark-connector-tpcds/src/main/scala/org/apache/kyuubi/spark/connector/tpcds/TPCDSBatchScan.scala:
##########
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.spark.connector.tpcds
+
+import java.time.LocalDate
+import java.time.format.DateTimeFormatter
+
+import scala.collection.JavaConverters._
+
+import io.trino.tpcds._

Review Comment:
   > well import trino stuff into spark, a bit weird
   
   It's not a plugin of trino, but a `dsdgen` written in Java and maintained by tirno https://github.com/trinodb/tpcds, originally comes from https://github.com/Teradata/tpcds.
   
   > is this whole thing delegating querying tpcds to some prebuilt trino underlying data?
   
   No. Data is generated on the fly when the table is scanned, every time.
   
   > I guess my use cases concerning tpcds is usually running benchmarks and comparing them with different engines, or same engine but different setups. does this connector help?
   
   It helps. This connector provides different scales of TPC-DS dataset,  it reduces your efforts in data preparation. 
   ```
   val scales: Array[Int] = Array(0, 1, 10, 100, 300, 1000, 3000, 10000, 30000, 100000)
   val databases: Array[String] = scales.map("sf" + _)
   ```
   But you may not want to run a benchmark based on the in-flight generated data because it's slower than pre-generated data stored in column-oriented format on DFS. Even though, it provides a pure SQL approach to generate TPC-DS dataset.
   
   1. Add jar `kyuubi-spark-connector-tpcds_2.12-${kyuubi_version}.jar`
   2. Add conf `spark.sql.catalog.tpcds=org.apache.kyuubi.spark.connector.tpcds.TPCDSCatalog`
   
   ```
   create database tpcds_sf10_parquet;
   create table tpcds_sf10_parquet.call_center using parquet select * from tpcds.sf10.call_center;
   create table tpcds_sf10_parquet. catalog_page using parquet select * from tpcds.sf10. catalog_page;
   ...
   ```
   



-- 
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