Skip to content

Conversation

@doanduyhai
Copy link
Contributor

@doanduyhai doanduyhai commented Jun 2, 2016

What is this PR for?

Cassandra interpreter V3:

  • Update documentation
  • Update interactive documentation
  • Add support for binary protocol V4
  • Implement new @requestTimeOut runtime option
  • Upgrade Java driver version to 3.0.1
  • Allow interpreter to add dynamic forms programmatically when using FormType.SIMPLE
  • Allow dynamic form using default Zeppelin syntax
  • Fixing typo on FallThroughPolicy
  • Look for data in AngularObjectRegistry before creating dynamic form
  • Add missing support for ALTER statements

What type of PR is it?

[Improvement]

Todos

  • - Test steps executed and confirmed working by the community

What is the Jira issue?

ZEPPELIN-901

How should this be tested?

  • Download and install locally Cassandra 3.5
  • Start Cassandra
  • Clone this pull request locally with:
    • git fetch origin pull/950/head:CassandraInterpreterV3
    • git checkout CassandraInterpreterV3
  • Build this version of Zeppelin with mvn clean package -DskipTests
  • Start Zeppelin and update the property cassandra.hosts of the Cassandra interpreter (set it to localhost or 127.0.0.1 depending on your configuration)
  • To test the ALTER statement, create a new paragraph with the following content:
%cassandra

CREATE KEYSPACE IF NOT EXISTS cassandra_v3 WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};
CREATE TABLE IF NOT EXISTS cassandra_v3.simple(key int PRIMARY KEY);
ALTER TABLE cassandra_v3.simple ADD value text;
DESCRIBE TABLE cassandra_v3.simple;

The result of this paragraph should be:
image

  • To test the support for Zeppelin dynamic form syntax, create a paragraph with the following content:
%cassandra

INSERT INTO cassandra_v3.simple(key,value) VALUES(1, 'first'); 
INSERT INTO cassandra_v3.simple(key,value) VALUES(2, 'second');
INSERT INTO cassandra_v3.simple(key,value) VALUES(3, 'third');

SELECT * FROM cassandra_v3.simple WHERE key=${key=1};

The result of this paragraph should be:
image

  • To test the legacy syntax for dynamic form, create a new paragraph with the following content:
%cassandra

INSERT INTO cassandra_v3.simple(key,value) VALUES(1, 'first'); 
INSERT INTO cassandra_v3.simple(key,value) VALUES(2, 'second');
INSERT INTO cassandra_v3.simple(key,value) VALUES(3, 'third');

SELECT * FROM cassandra_v3.simple WHERE key={{key=1|2|3}};

The result of this paragraph should be:
image

  • To test the override of AngularObject upon dynamic form, create 2 new paragraphs with the following content

First paragraph content:

%angular

<form class="form-inline">
  <div class="form-group">
    <label for="keyId">Key: </label>
    <input type="text" class="form-control" id="keyId" placeholder="key id ..." ng-model="key_id"></input>
  </div>
  <button type="submit" class="btn btn-primary" ng-click="z.angularBind('key_id',key_id,'PUT_HERE_SECOND_PARAGRAPH_ID'); z.runParagraph('PUT_HERE_SECOND_PARAGRAPH_ID')"> Bind</button>
</form>

Second paragraph content:

%cassandra

INSERT INTO cassandra_v3.simple(key,value) VALUES(1, 'first'); 
INSERT INTO cassandra_v3.simple(key,value) VALUES(2, 'second');
INSERT INTO cassandra_v3.simple(key,value) VALUES(3, 'third');

SELECT * FROM cassandra_v3.simple WHERE key={{key_id=1}};

Replace PUT_HERE_SECOND_PARAGRAPH_ID in the angular code of the first paragraph by the real paragraph id of the second paragraph. Execute the first paragraph, put a value into the input text (3) and click on Bind, you should see the following result:

image

Screenshots (if appropriate)

Questions:

  • Does the licenses files need update? --> No
  • Is there breaking changes for older versions? --> No
  • Does this needs documentation? --> Yes

@doanduyhai doanduyhai force-pushed the CassandraInterpreterV3 branch from e604691 to 8062030 Compare June 2, 2016 09:42
The same remark does apply to the <strong>prepared statement hash map</strong>, it is shared by <strong>all users</strong> using the same instance of <strong>Cassandra</strong> interpreter.
<br/><br/>
Recently, <strong>Zeppelin</strong> allows you to choose the level of isolation for your interpreters (see
<strong><a href="http://zeppelin.incubator.apache.org/docs/0.6.0-incubating-SNAPSHOT/manual/interpreters.html" target="_blank">Interpreter Binding Mode</a></strong> ).
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @doanduyhai :)
Could you change this link to http://zeppelin.apache.org/docs/0.6.0-incubating-SNAPSHOT/manual/interpreters.html ?

@AhyoungRyu
Copy link
Contributor

@doanduyhai Great work indeed!
I saw you removed cassandra-InterpreterSelection.png in this PR. But there is still this image link in cassandra.md. Could you check this one ? :)

@doanduyhai
Copy link
Contributor Author

@AhyoungRyu PR updated with your remarks

@AhyoungRyu
Copy link
Contributor

@doanduyhai Cool. Thanks for the quick response :)

@Leemoonsoo
Copy link
Member

Looks good to me!

@Leemoonsoo
Copy link
Member

Merge if there're no more discussions.

@asfgit asfgit closed this in 68b9b00 Jun 11, 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