[ 
https://issues.apache.org/jira/browse/DRILL-8011?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17430566#comment-17430566
 ] 

ASF GitHub Bot commented on DRILL-8011:
---------------------------------------

cgivre commented on a change in pull request #2337:
URL: https://github.com/apache/drill/pull/2337#discussion_r731905254



##########
File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/store/DropboxFileSystemTest.java
##########
@@ -0,0 +1,194 @@
+/*
+ * 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.drill.exec.store;
+
+import org.apache.drill.common.logical.FormatPluginConfig;
+import org.apache.drill.common.logical.StoragePluginConfig;
+import org.apache.drill.common.types.TypeProtos.DataMode;
+import org.apache.drill.common.types.TypeProtos.MinorType;
+import org.apache.drill.exec.physical.rowSet.RowSet;
+import org.apache.drill.exec.record.metadata.SchemaBuilder;
+import org.apache.drill.exec.record.metadata.TupleMetadata;
+import org.apache.drill.exec.store.dfs.FileSystemConfig;
+import org.apache.drill.exec.store.dfs.WorkspaceConfig;
+import org.apache.drill.exec.store.easy.json.JSONFormatPlugin.JSONFormatConfig;
+import org.apache.drill.exec.store.easy.text.TextFormatPlugin.TextFormatConfig;
+import org.apache.drill.test.ClusterFixture;
+import org.apache.drill.test.ClusterTest;
+import org.apache.drill.test.rowSet.RowSetComparison;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+@Ignore("Please create a Dropbox API key and run these tests manually")
+public class DropboxFileSystemTest extends ClusterTest {
+
+  private static final String ACCESS_TOKEN = "<Your Dropbox Access Token 
Here>";
+
+  /*
+   All test files can be found in java-exec/src/test/resources/dropboxTestFiles
+
+  Instructions for running Dropbox Unit Tests
+  1.  Get your Dropbox API key as explained in the Drill docs and paste it 
above into the ACCESS_TOKEN variable.
+  2.  In your dropbox account, create a folder called 'csv' and upload the 
file hdf-test.csvh into that folder
+  3.  In your dropbox account, upload the file http-pcap.json to the root 
directory of your dropbox account
+  4.  In the testListFiles test, you will have to update the modified dates
+  5.  Run tests.
+   */
+
+  @BeforeClass
+  public static void setup() throws Exception {
+    assertTrue(! ACCESS_TOKEN.equalsIgnoreCase("<Your Dropbox Access Token 
Here>"));
+    ClusterTest.startCluster(ClusterFixture.builder(dirTestWatcher));
+
+    Map<String, String> dropboxConfigVars = new HashMap<>();
+    dropboxConfigVars.put("dropboxAccessToken", ACCESS_TOKEN);
+
+    // Create workspaces
+    WorkspaceConfig rootWorkspace = new WorkspaceConfig("/", false, null, 
false);
+    WorkspaceConfig csvWorkspace = new WorkspaceConfig("/csv", false, null, 
false);
+    Map<String, WorkspaceConfig> workspaces = new HashMap<>();
+    workspaces.put("root", rootWorkspace);
+    workspaces.put("csv", csvWorkspace);
+
+    // Add formats
+    Map<String, FormatPluginConfig> formats = new HashMap<>();
+    List<String> jsonExtensions = new ArrayList<>();
+    jsonExtensions.add("json");
+    FormatPluginConfig jsonFormatConfig = new JSONFormatConfig(jsonExtensions);
+
+    // CSV Format
+    List<String> csvExtensions = new ArrayList<>();
+    csvExtensions.add("csv");

Review comment:
       Fixed




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


> Add Dropbox File System to Drill
> --------------------------------
>
>                 Key: DRILL-8011
>                 URL: https://issues.apache.org/jira/browse/DRILL-8011
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Storage - Other
>    Affects Versions: 1.19.0
>            Reporter: Charles Givre
>            Assignee: Charles Givre
>            Priority: Major
>             Fix For: 1.20.0
>
>
> This PR proposes to add the ability to query files stored in Dropbox to 
> Apache Drill. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to