[GitHub] [drill] vvysotskyi commented on a change in pull request #2067: DRILL-7716: Create Format Plugin for SPSS Files

2020-05-02 Thread GitBox


vvysotskyi commented on a change in pull request #2067:
URL: https://github.com/apache/drill/pull/2067#discussion_r419001452



##
File path: contrib/format-spss/README.md
##
@@ -0,0 +1,87 @@
+# Format Plugin for SPSS (SAV) Files
+This format plugin enables Apache Drill to read and query Statistical Package 
for the Social Sciences (SPSS) (or Statistical Product and Service Solutions) 
data files. According
+ to Wikipedia: [1]
+ 
+ SPSS is a widely used program for statistical analysis in social science. It 
is also used by market researchers, health researchers, survey companies, 
government, education researchers, marketing organizations, data miners, and 
others. The original SPSS manual (Nie, Bent & Hull, 1970) has been described as 
one of "sociology's most influential books" for allowing ordinary researchers 
to do their own statistical analysis. In addition to statistical analysis, data 
management (case selection, file reshaping, creating derived data) and data 
documentation (a metadata dictionary is stored in the datafile) are features of 
the base software.

Review comment:
   Blockquote may be used for quoting from Wiki.

##
File path: contrib/format-spss/README.md
##
@@ -0,0 +1,87 @@
+# Format Plugin for SPSS (SAV) Files
+This format plugin enables Apache Drill to read and query Statistical Package 
for the Social Sciences (SPSS) (or Statistical Product and Service Solutions) 
data files. According
+ to Wikipedia: [1]
+ 
+ SPSS is a widely used program for statistical analysis in social science. It 
is also used by market researchers, health researchers, survey companies, 
government, education researchers, marketing organizations, data miners, and 
others. The original SPSS manual (Nie, Bent & Hull, 1970) has been described as 
one of "sociology's most influential books" for allowing ordinary researchers 
to do their own statistical analysis. In addition to statistical analysis, data 
management (case selection, file reshaping, creating derived data) and data 
documentation (a metadata dictionary is stored in the datafile) are features of 
the base software.
+ 
+ 
+## Configuration 
+To configure Drill to read SPSS files, simply add the following code to the 
formats section of your file-based storage plugin.  This should happen 
automatically for the default
+ `cp`, `dfs`, and `S3` storage plugins.
+ 
+ Other than the file extensions, there are no variables to configure.
+ 
+```json
+"spss": {

Review comment:
   Please fix the formatting.

##
File path: contrib/format-spss/README.md
##
@@ -0,0 +1,87 @@
+# Format Plugin for SPSS (SAV) Files
+This format plugin enables Apache Drill to read and query Statistical Package 
for the Social Sciences (SPSS) (or Statistical Product and Service Solutions) 
data files. According
+ to Wikipedia: [1]

Review comment:
   Wikipedia may be made as a reference instead of putting the long at the 
end of the doc.

##
File path: 
contrib/format-spss/src/main/java/org/apache/drill/exec/store/spss/SpssBatchReader.java
##
@@ -0,0 +1,242 @@
+/*
+ * 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.spss;
+
+import com.bedatadriven.spss.SpssDataFileReader;
+import com.bedatadriven.spss.SpssVariable;
+import org.apache.drill.common.exceptions.UserException;
+import org.apache.drill.common.types.TypeProtos;
+import 
org.apache.drill.exec.physical.impl.scan.file.FileScanFramework.FileSchemaNegotiator;
+import org.apache.drill.exec.physical.impl.scan.framework.ManagedReader;
+import org.apache.drill.exec.physical.resultSet.ResultSetLoader;
+import org.apache.drill.exec.physical.resultSet.RowSetLoader;
+import org.apache.drill.exec.record.metadata.SchemaBuilder;
+import org.apache.drill.exec.record.metadata.TupleMetadata;
+import org.apache.drill.exec.vector.accessor.ScalarWriter;
+import org.apache.hadoop.mapred.FileSplit;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class SpssBatchReader implements ManagedReader {
+
+  private static final Logger logge

[GitHub] [drill] vvysotskyi commented on a change in pull request #2067: DRILL-7716: Create Format Plugin for SPSS Files

2020-05-04 Thread GitBox


vvysotskyi commented on a change in pull request #2067:
URL: https://github.com/apache/drill/pull/2067#discussion_r419660268



##
File path: pom.xml
##
@@ -359,6 +359,7 @@
 **/*.pcap
 **/*.log1
 **/*.log2
+**/*.sav

Review comment:
   Please also update the exclusion list for `license-maven-plugin`.





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:
us...@infra.apache.org