You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/10/10 07:04:41 UTC

[GitHub] [iotdb] HTHou commented on a change in pull request #1739: [IOTDB-507] Add zeppelin-interpreter module

HTHou commented on a change in pull request #1739:
URL: https://github.com/apache/iotdb/pull/1739#discussion_r502756540



##########
File path: zeppelin-interpreter/src/main/java/org/apache/zeppelin/iotdb/IoTDBInterpreter.java
##########
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zeppelin.iotdb;
+
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.Set;
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.session.SessionDataSet;
+import org.apache.iotdb.tsfile.read.common.Field;
+import org.apache.iotdb.tsfile.read.common.RowRecord;
+import org.apache.thrift.TException;
+import org.apache.zeppelin.interpreter.Interpreter;
+import org.apache.zeppelin.interpreter.InterpreterContext;
+import org.apache.zeppelin.interpreter.InterpreterResult;
+import org.apache.zeppelin.interpreter.InterpreterResult.Code;
+import org.apache.zeppelin.interpreter.InterpreterResult.Type;
+import org.apache.iotdb.session.Session;
+
+public class IoTDBInterpreter extends Interpreter {
+
+	private IoTDBConnectionException connectionException;
+	private Session session;
+
+	public IoTDBInterpreter(Properties property) {
+		super(property);
+	}

Review comment:
       Please follow the format of other java files. Or use `.checkstyle ` to do the format check.

##########
File path: zeppelin-interpreter/src/test/java/org/apache/zeppelin/iotdb/IoTDBInterpreterTest.java
##########
@@ -0,0 +1,58 @@
+package org.apache.zeppelin.iotdb;
+import java.util.Properties;
+import org.apache.zeppelin.interpreter.InterpreterResult;
+import org.junit.After;

Review comment:
       Add license header and reformat.

##########
File path: zeppelin-interpreter/pom.xml
##########
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

Review comment:
       Please add the apache header.
   You can see it in other pom files.

##########
File path: zeppelin-interpreter/src/main/resources/interpreter-setting.json
##########
@@ -0,0 +1,39 @@
+[
+  {
+    "group": "iotdb",
+    "name": "iotodb",

Review comment:
       This file also needs a license header. 

##########
File path: zeppelin-interpreter/src/test/java/org/apache/zeppelin/iotdb/IoTDBInterpreterTest.java
##########
@@ -0,0 +1,58 @@
+package org.apache.zeppelin.iotdb;
+import java.util.Properties;
+import org.apache.zeppelin.interpreter.InterpreterResult;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class IoTDBInterpreterTest {
+	private IoTDBInterpreter interpreter;
+
+	@Before
+	public void open() {
+		Properties properties = new Properties();
+		interpreter = new IoTDBInterpreter(properties);
+		interpreter.open();
+	}
+
+	@After
+	public void close() {
+		interpreter.close();
+	}
+
+	@Test
+	public void testNonQuery() {
+		for(int i=0;i<100;i++){

Review comment:
       ```suggestion
   		for (int i = 0;i < 100; i++) {
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org