You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2020/11/18 02:05:38 UTC

[GitHub] [drill] cgivre opened a new pull request #2116: DRILL-7532: Convert Syslog to EVF

cgivre opened a new pull request #2116:
URL: https://github.com/apache/drill/pull/2116


   # [DRILL-7532](https://issues.apache.org/jira/browse/DRILL-7532): Convert Syslog to EVF
   
   ## Description
   
   Converts the Syslog format plugin to use EVF. 
   
   ## Documentation
   There are no changes visible to the user.
   
   ## Testing
   Ran unit tests associated with the syslog plugin.  Added unit tests for compressed files, SerDe and limit pushdown.


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



[GitHub] [drill] cgivre commented on pull request #2116: DRILL-7532: Convert Syslog to EVF

Posted by GitBox <gi...@apache.org>.
cgivre commented on pull request #2116:
URL: https://github.com/apache/drill/pull/2116#issuecomment-747528857


   > I recommend remove the useless spaces at `boolean isProjected (ScalarWriter writer)`.
   
   Spacing 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.

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



[GitHub] [drill] cgivre merged pull request #2116: DRILL-7532: Convert Syslog to EVF

Posted by GitBox <gi...@apache.org>.
cgivre merged pull request #2116:
URL: https://github.com/apache/drill/pull/2116


   


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



[GitHub] [drill] cgivre commented on pull request #2116: DRILL-7532: Convert Syslog to EVF

Posted by GitBox <gi...@apache.org>.
cgivre commented on pull request #2116:
URL: https://github.com/apache/drill/pull/2116#issuecomment-747515490


   > The reader must read rows to determine the schema when `isComplete=false` ?
   
   The syslog format has a mix of known and unknown fields, so we have to set `isComplete` to `false`. 


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



[GitHub] [drill] vdiravka commented on a change in pull request #2116: DRILL-7532: Convert Syslog to EVF

Posted by GitBox <gi...@apache.org>.
vdiravka commented on a change in pull request #2116:
URL: https://github.com/apache/drill/pull/2116#discussion_r542662674



##########
File path: contrib/format-syslog/src/main/java/org/apache/drill/exec/store/syslog/SyslogBatchReader.java
##########
@@ -0,0 +1,335 @@
+/*
+ * 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.syslog;
+
+import org.apache.drill.common.AutoCloseables;
+import org.apache.drill.common.exceptions.CustomErrorContext;
+import org.apache.drill.common.exceptions.UserException;
+import org.apache.drill.common.types.TypeProtos;
+import org.apache.drill.common.types.TypeProtos.MinorType;
+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.ColumnMetadata;
+import org.apache.drill.exec.record.metadata.MetadataUtils;
+import org.apache.drill.exec.record.metadata.SchemaBuilder;
+import org.apache.drill.exec.record.metadata.TupleMetadata;
+import org.apache.drill.exec.store.dfs.easy.EasySubScan;
+import org.apache.drill.exec.vector.accessor.ScalarWriter;
+import org.apache.drill.exec.vector.accessor.TupleWriter;
+import org.apache.hadoop.mapred.FileSplit;
+import org.joda.time.Instant;
+import org.realityforge.jsyslog.message.StructuredDataParameter;
+import org.realityforge.jsyslog.message.SyslogMessage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+public class SyslogBatchReader implements ManagedReader<FileSchemaNegotiator> {
+  private static final Logger logger = LoggerFactory.getLogger(SyslogBatchReader.class);
+  private final String STRUCTURED_DATA_PREFIX = "structured_data_";

Review comment:
       ```suggestion
     private static final String STRUCTURED_DATA_PREFIX = "structured_data_";
   ```

##########
File path: contrib/format-syslog/src/test/java/org/apache/drill/exec/store/syslog/TestSyslogFormat.java
##########
@@ -58,6 +66,7 @@ private static void defineSyslogPlugin() throws ExecutionSetupException {
 
     // Define a temporary plugin for the "cp" storage plugin.

Review comment:
       ```suggestion
       // Define a temporary plugin for the "cp" and "dsp" storage plugins.
   ```

##########
File path: contrib/format-syslog/src/test/resources/syslog/test.syslog1
##########
@@ -1,2 +1,2 @@
 <86>1 2015-08-05T21:58:59.693Z 192.168.2.132 SecureAuth0 23108 ID52020 [SecureAuth@27389 UserAgent="Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko" UserHostAddress="192.168.2.132" BrowserSession="0gvhdi5udjuqtweprbgoxilc" Realm="SecureAuth0" Appliance="secureauthqa.gosecureauth.com" Company="SecureAuth Corporation" UserID="Tester2" PEN="27389" HostName="192.168.2.132" Category="AUDIT" Priority="4"] Found the user for retrieving user's profile
-<134>1 2016-04-01T16:44:58Z MacBook-Pro-3 - 94473 - - {"pid":94473,"hostname":"MacBook-Pro-3","level":30,"msg":"hello world","time":1459529098958,"v":1}
\ No newline at end of file
+<134>1 2016-04-01T16:44:00.58Z MacBook-Pro-3 - 94473 - - {"pid":94473,"hostname":"MacBook-Pro-3","level":30,"msg":"hello world","time":1459529098958,"v":1}

Review comment:
       ```suggestion
   <134>1 2016-04-01T16:44:00.58Z MacBook-Pro-3 - 94473 - - {"pid":94473,"hostname":"MacBook-Pro-3","level":30,"msg":"hello world","time":1459529098958,"v":1}
   
   ```




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