Comments (4)
@juliuszsompolski
The store_sales table defines a composite primary key of (ss_item_sk, ss_ticket_number)
. The data was indeed generated correctly. Sorry for the noise.
scala> val res = sql("SELECT distinct count(ss_item_sk, ss_ticket_number) FROM store_sales")
res: org.apache.spark.sql.DataFrame = [count(ss_item_sk, ss_ticket_number): bigint]
scala> res.show
+-----------------------------------+
|count(ss_item_sk, ss_ticket_number)|
+-----------------------------------+
| 2879789|
+-----------------------------------+
from spark-sql-perf.
Please share how you generate data.
Do you use TPCDS kit from https://github.com/databricks/tpcds-kit and follow https://github.com/databricks/spark-sql-perf#setup-a-benchmark ?
from spark-sql-perf.
@juliuszsompolski Thanks for you response. I did use the TPC-DS kit and followed the instructions listed on "set up a benchmark". I have attached the commands that I ran. I noticed this because I tried to write the data to a Phoenix table and ended up with less number of rows than expected. I will rerun the benchmark and see if I still see the issue, or try and repro in a test.
import com.databricks.spark.sql.perf.tpcds.TPCDSTables
import org.apache.spark.SparkContext
import org.apache.spark.sql.SQLContext
val sqlContext = new SQLContext(sc)
// Set:
val rootDir = "/tpch-ds-data"
val databaseName = "TPCH"
val scaleFactor = "1"
val format = "parquet"
// Run:
val tables = new TPCDSTables(sqlContext,
dsdgenDir = "/tmp/tpcds-kit/tools", // location of dsdgen
scaleFactor = scaleFactor,
useDoubleForDecimal = false, // true to replace DecimalType with DoubleType
useStringForDate = false) // true to replace DateType with StringType
tables.genData(
location = rootDir,
format = format,
overwrite = true, // overwrite the data that is already there
partitionTables = true, // create the partitioned fact tables
clusterByPartitionColumns = true, // shuffle to get partitions coalesced into single files.
filterOutNullPartitionValues = false, // true to filter out the partition with NULL key value
tableFilter = "", // "" means generate all tables
numPartitions = 100) // how many dsdgen partitions to run - number of input tasks.
// Create the specified database
sql(s"create database $databaseName")
// Create metastore tables in a specified database for your data.
// Once tables are created, the current database will be switched to the specified database.
tables.createExternalTables(rootDir, "parquet", databaseName, overwrite = true, discoverPartitions = true)
// Or, if you want to create temporary tables
// tables.createTemporaryTables(location, format)
// For CBO only, gather statistics on all columns:
tables.analyzeTables(databaseName, analyzeColumns = true)
// write to phoenix table
val df = sql("SELECT * FROM store_sales")
df.write.format("org.apache.phoenix.spark").mode("overwrite").option("table", "store_sales"").option("zkUrl", "m1:2181").save()
from spark-sql-perf.
Right,
I did not look fully awake at your issue yesterday :-).
ss_item_sk
is the foreign key to the item
table. store_sales
is a denormalized orders-lineitem table, where ss_ticket_number
is the order key, and there can be multiple items on an order
, hence the item key and order key together form the key.
from spark-sql-perf.
Related Issues (20)
- How to put data into external storage?
- suitable exector-memory for spark-sql-perf testing
- Validating the correctness of results HOT 2
- The Query and Generate mismatch
- For spark-3.0.0, there is no method called org.apache.spark.sql.SQLContext.createExternalTable
- build errors due to dependencies HOT 1
- Spark 3.0.0 compile error
- Getting error when analyzing the columns
- Use CHAR/VARCHAR types in TPCDSTables HOT 2
- Error when trying to create binary from source code
- sbt run error with unresolved dependency
- NoSuchMethodError on Spark 3.1 in Databricks HOT 1
- sbt package failed with unresolved dependency HOT 5
- executor_per_core is fixed to 1 vCores in spark-sql-perf on EMR
- Build failed
- Compilation failed for Spark 3.2.0
- command "build/sbt .." failed with unresolved dependency HOT 1
- genData, the data isn`t stored the location I set. HOT 1
- genData,the tpchdata always stored in the dbgen directory.
- does it has plan to support tpcds 3.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spark-sql-perf.