This example shows how an application can interact with SnappyStore in Split cluster mode.
By this mode an application can access metastore of an existing running SnappyStore. Hence it can
query tables, write to tables which reside in a SnappyStore.
To run this example you need to set up a Snappy Cluster first . To do the same, follow the steps
mentioned below.
1. Go to SNAPPY_HOME. Your Snappy installation directory.
2. Start a Snappy cluster
./sbin/snappy-start-all.sh
This will start a simple cluster with one data node, one lead node and a locator
3. Open Snappy Shell
./bin/snappy-sql
This will open Snappy shell which can be used to create and query tables.
4. Connect to the Snappy Cluster. On the shell prompt type
connect client 'localhost:1527';
5. Create a column table and insert some rows in SnappyStore. Type the followings in Snappy Shell.
CREATE TABLE SNAPPY_COL_TABLE(r1 Integer, r2 Integer) USING COLUMN;
insert into SNAPPY_COL_TABLE VALUES(1,1);
insert into SNAPPY_COL_TABLE VALUES(2,2);
6. Run this example to see how this program interacts with the Snappy Cluster
table (SNAPPY_COL_TABLE) that we created. This program also creates a table in SnappyStore.
After running this example you can also query the table from Snappy shell
e.g. select count(*) from TestColumnTable.
This example shows how an application can interact with SnappyStore in Split cluster mode. By this mode an application can access metastore of an existing running SnappyStore. Hence it can query tables, write to tables which reside in a SnappyStore.
To run this example you need to set up a Snappy Cluster first . To do the same, follow the steps mentioned below.
1. Go to SNAPPY_HOME. Your Snappy installation directory.
2. Start a Snappy cluster ./sbin/snappy-start-all.sh This will start a simple cluster with one data node, one lead node and a locator
3. Open Snappy Shell ./bin/snappy-sql This will open Snappy shell which can be used to create and query tables.
4. Connect to the Snappy Cluster. On the shell prompt type connect client 'localhost:1527';
5. Create a column table and insert some rows in SnappyStore. Type the followings in Snappy Shell.
CREATE TABLE SNAPPY_COL_TABLE(r1 Integer, r2 Integer) USING COLUMN;
insert into SNAPPY_COL_TABLE VALUES(1,1); insert into SNAPPY_COL_TABLE VALUES(2,2);
6. Run this example to see how this program interacts with the Snappy Cluster table (SNAPPY_COL_TABLE) that we created. This program also creates a table in SnappyStore. After running this example you can also query the table from Snappy shell e.g. select count(*) from TestColumnTable.
bin/run-example snappydata.SmartConnectorExample