<commit_before>Getting started
****************

How to install Crossdata
=========================
There are different ways to install Crossdata depending of your necessities.
One way is using maven::

    > mvn clean package -Ppackage

and it could be packaged with hive dependencies too::

    > mvn clean package -Ppackage -Phive

You can build a Spark Distribution with Crossdata libraries running the make-distribution-crossdata script::

    > cd scripts
    > ./make-distribution-crossdata.sh

This will build Spark with the following options:
    - Crossdata with Cassandra support
    - Spark Version v1.5.1
    - Spark's Hadoop  Version 2.6.0
    - Yarn support
    - Hive integration for SparkSQL
    - Scala version 2.10
    - Crossdata shell

For others options run ./make-distribution-crossdata.sh --help


Running Crossdata standalone
=============================
To run crossdata in a standalone mode, it's necessary to install crossdata using the make-distribution-crossdata
script first.
Once Crossdata is installed, just run this::

    > bin/stratio-xd-shell --cassandra --mongodb

And then you can execute::

    >xdContext.sql("CREATE TEMPORARY TABLE students USING com.stratio.crossdata.sql.sources.cassandra
            OPTIONS (keyspace 'highschool', table 'students', cluster 'students', pushdown 'true',
            spark_cassandra_connection_host '127.0.0.1')")
    >xdContext.sql("SELECT * FROM students").collect()

<commit_msg>Update 2_getting_started.rst<commit_after>Getting started
****************

How to build Crossdata
=========================
There are different ways to install Crossdata depending of your necessities.
One way is using maven::

    > mvn clean package -Ppackage

and it could be packaged with hive dependencies too::

    > mvn clean package -Ppackage -Phive

You can build a Spark Distribution with Crossdata libraries running the make-distribution-crossdata script::

    > cd scripts
    > ./make-distribution-crossdata.sh

This will build Spark with the following options:
    - Spark-1.5.1/hadoop2.6
    - Crossdata shell
    - And all available Crossdata providers

For others options run ./make-distribution-crossdata.sh --help


Running Crossdata standalone
=============================
To run crossdata in a standalone mode, it's necessary to install crossdata using the make-distribution-crossdata
script first.
Once Crossdata is installed, just run this::

    > bin/stratio-xd-shell --cassandra --mongodb

And then you can execute::

    >xdContext.sql("CREATE TEMPORARY TABLE students USING com.stratio.crossdata.sql.sources.cassandra
            OPTIONS (keyspace 'highschool', table 'students', cluster 'students', pushdown 'true',
            spark_cassandra_connection_host '127.0.0.1')")
    >xdContext.sql("SELECT * FROM students").collect()


{'fraction_non_alphanumeric': 0.12114771519659936, 'fraction_numerical': 0.009564293304994687, 'mean_word_length': 3.852233676975945, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4029737', 'n_tokens_mistral': 803, 'n_tokens_neox': 734, 'n_words': 281}