iotdb-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [iotdb] jixuan1989 commented on a change in pull request #2963: Flink IoTDB source
Date Fri, 02 Apr 2021 01:36:43 GMT

jixuan1989 commented on a change in pull request #2963:
URL: https://github.com/apache/iotdb/pull/2963#discussion_r606029471



##########
File path: example/flink/src/main/java/org/apache/iotdb/flink/FlinkIoTDBSource.java
##########
@@ -0,0 +1,95 @@
+/*
+ * 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.iotdb.flink;
+
+import org.apache.iotdb.flink.options.IoTDBSourceOptions;
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.rpc.TSStatusCode;
+import org.apache.iotdb.session.Session;
+import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
+import org.apache.iotdb.tsfile.read.common.RowRecord;
+
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class FlinkIoTDBSource {
+
+  static final String LOCAL_HOST = "127.0.0.1";
+  static final String ROOT_SG1_D1_S1 = "root.sg1.d1.s1";
+  static final String ROOT_SG1_D1 = "root.sg1.d1";
+
+  public static void main(String[] args) throws Exception {
+    prepareData();
+
+    // run the flink job on local mini cluster
+    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+
+    IoTDBSourceOptions ioTDBSourceOptions =
+        new IoTDBSourceOptions("127.0.0.1", 6667, "root", "root", "select s1 from " + ROOT_SG1_D1);

Review comment:
       align by device




-- 
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



Mime
View raw message