DataStax Cassandra Java Spark Examples
WORK IN PROGRESS
Basic SparkSQL Demo
1st demo is a simple SparkSQL script
This creates a Cassandra table, inserts a few lines of data, and uses SparkSQL to return the average length of songs per song category
It uses dse spark-submit to run the script
Based on DSE 4.7.3 and the DataStax Cassandra Spark Connector
You will need to create a "lib" folder and copy dse-4.7.3.jar into it. If you use a different version of DSE, update pom.xml
- compile project**
mvn package
- run program
dse spark-submit --class simpleSpark.BasicSparkSQL ./target/BasicSparkDemo-0.1.jar
** if you don't have Maven
-
download Maven: https://maven.apache.org/download.cgi
-
add to path
export PATH=[dir]/apache-maven-3.3.3/bin:$PATH