Accessing Datastax Spark — Basic Examples
DSE 5.0.7, Spark 1.6.3
Published in
Nov 26, 2019
Accessing Spark
Accessing spark from outside the spark cluster
dse spark — master spark://MASTER_ADDRESS:7077
Spark SQL
$ dse -u avm_analytics -p avm1111 spark-sqlspark-sql> select count(*) from avm.transactions where txn_date=’2017_05_08';446313Time taken: 523.556 seconds, Fetched 1 row(s)
PySpark
$ dse -u avm_analytics -p avm1111 pyspark>>> sqlContext.sql(“select count(*) from avm.test”)
DataFrame[_c0: bigint] >>> sqlContext.sql(“select count(*) from avm.test”).collect() [Row(_c0=4)] >>> sqlContext.sql(“select * from avm.test”).collect()[Row(event_id=30, event_name=u’cat’), Row(event_id=1, event_name=u’aaa’), Row(event_id=2, event_name=u’bbb’), Row(event_id=40, event_name=u’fox’)]
Continue reading -:
https://blog.avmconsulting.net/posts/2017-10-16-accessing-datastax-spark-basic-examples/
👋 Join us today !!
If this post was helpful, please click the clap 👏 button below a few times to show your support! ⬇