Skip to content

Conversation

jtgrabowski
Copy link
Collaborator

assembly works for all of them
sbt and gradle can figure out DSE classpath (thanks Russ)

@bcantoni
Copy link

bcantoni commented Jul 1, 2016

Are there meant to be Gradle examples as well? This PR seems to remove them all.

@jtgrabowski
Copy link
Collaborator Author

@bcantoni yes, there are moved to scala/gradle and java/gradle dirs

@RussellSpitzer
Copy link
Contributor

These should all be converted to use the now publicly available DataStax Spark dependency that Artem and Predrag built

@jtgrabowski
Copy link
Collaborator Author

will do

@bcantoni
Copy link

bcantoni commented Jul 7, 2016

In this PR I see two build.gradle files which are being deleted, but none which are being added or moved. Under scala and java I just see maven and sbt dirs.

Regarding the readme file and discussion of dependencies, would it help to have a few concrete examples with real version numbers listed? This seems to be a tricky part for people, so I think a couple of real examples here would be helpful, like:

  • With DSE
    • DSE 5.0.0
    • DSE 4.8.8
    • DSE 4.7.8
  • Without DSE
    • Spark 2.0, Cassandra 3.0, Connector 1.6
    • Spark x, Cassandra y, Connector z
    • etc.

assembly works for all of them
sbt and gradle can figure out DSE classpath (thanks Russ)
@jtgrabowski
Copy link
Collaborator Author

@bcantoni you are right, sorry, my .gitignore file ate gradle examples

dse is for users with DSE environment (these projects use
DSE connector dependency)

oss id for open source users with manual dependencies
@jtgrabowski
Copy link
Collaborator Author

@RussellSpitzer moved to publicly available DataStax Spark dependency that Artem and Predrag built

@bcantoni channged to project structure to dse vs oss. dse uses dependency that Russ mentioned, which is available only for 5.0.1. Do we want to have "custom" examples for older versions of DSE?
For oss the version compatibility table should be sufficient. We could mention it in the readme file, wdyt?

@bcantoni
Copy link

The version compatibility table on the connector site is good and we can point to it. However it (intentionally) does not list the DSE version.

In any case if I take a step upwards, I think we want to answer the use case of "I'm using DSE version x.y, how do I set up my Spark project to work with it?". A table full of versions would probably be impossible to maintain, so maybe just an explanation of how to find and set the Spark and Spark Connector versions based on the DSE version you're using. The DSE Release Notes pages might be helpful in this regard.

}
}

configurations {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May want to add a quick comment "The provided configuration behaves the same as the sbt "provided" keyword which will cause jars to be excluded from assembled fat-jar"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example jar command is going to technically build a fat jar incase that wasn't clear :)

@RussellSpitzer
Copy link
Contributor

I left a few notes

@jtgrabowski
Copy link
Collaborator Author

@RussellSpitzer applied your remarks

@bcantoni at the moment there is no way to use current dse template for DSE version lower than 5.0.0 (no connector artifact published). We have two options here.

  1. Restore previous project template for DSE < 5.0.0
  2. Talk to Artem if it is possible to publish connector artifact for DSE < 5.0.0 and if it is, use current project template for all DSE versions

I'll talk to Artem when he is back from vacation and get back to you. Let's treat (1) as a backup plan.

sqlContext.setKeyspace("ks");
List<Tuple2<Integer, Integer>> sqlReadData = sqlContext.sql("SELECT * FROM kv").javaRDD()
// Read Data Using the Hive Context
List<Tuple2<Integer, Integer>> sqlReadData = hiveContext
Copy link
Collaborator Author

@jtgrabowski jtgrabowski Jul 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to ditch select statement because I couldn't get rid of the exception "table kv.ks couldn't be found".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without DSE the metastore won't exist, but you can make an entry by registering a DataFrame or by using the following syntax

https://github.com/datastax/spark-cassandra-connector/blob/master/doc/14_data_frames.md#creating-dataframes-using-spark-sql

@RussellSpitzer
Copy link
Contributor

I'm +1, This is a great starting point for our users. We can always do more tweaks later

@jtgrabowski
Copy link
Collaborator Author

Russ, could you please merge this (I do not have required privileges)?

@RussellSpitzer RussellSpitzer merged commit 06a9487 into DataStax-Examples:master Aug 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants