You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2023/03/28 15:09:11 UTC
[streampipes] branch dev updated: [hotfix] Add test for DataLakeQueryBuilder (#1459)
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new de73be881 [hotfix] Add test for DataLakeQueryBuilder (#1459)
de73be881 is described below
commit de73be88180f6da488a49acb57bf26a32b487e3b
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Tue Mar 28 17:08:58 2023 +0200
[hotfix] Add test for DataLakeQueryBuilder (#1459)
---
.../dataexplorer/sdk/DataLakeQueryBuilderTest.java | 40 ++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/streampipes-data-explorer/src/test/java/org/apache/streampipes/dataexplorer/sdk/DataLakeQueryBuilderTest.java b/streampipes-data-explorer/src/test/java/org/apache/streampipes/dataexplorer/sdk/DataLakeQueryBuilderTest.java
new file mode 100644
index 000000000..82a999463
--- /dev/null
+++ b/streampipes-data-explorer/src/test/java/org/apache/streampipes/dataexplorer/sdk/DataLakeQueryBuilderTest.java
@@ -0,0 +1,40 @@
+/*
+ * 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.streampipes.dataexplorer.sdk;
+
+import org.junit.Test;
+
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+public class DataLakeQueryBuilderTest {
+
+ private static final String MEASUREMENT = "measurement";
+ @Test
+ public void withSimpleColumnsTest() {
+ var result = DataLakeQueryBuilder
+ .create(MEASUREMENT)
+ .withSimpleColumns(List.of("one", "two"))
+ .build();
+
+ var expected = String.format("SELECT one,two FROM \"%s\";", MEASUREMENT);
+ assertEquals(expected , result.getCommand());
+ }
+}
\ No newline at end of file