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 2019/10/06 01:38:52 UTC

[GitHub] [drill] paul-rogers commented on a change in pull request #1862: DRILL-7385: Convert PCAP Format Plugin to EVF

paul-rogers commented on a change in pull request #1862: DRILL-7385: Convert PCAP Format Plugin to EVF
URL: https://github.com/apache/drill/pull/1862#discussion_r331767252
 
 

 ##########
 File path: exec/java-exec/src/main/java/org/apache/drill/exec/store/pcap/schema/Schema.java
 ##########
 @@ -78,4 +81,23 @@ public ColumnDto getColumnByIndex(int i) {
   public int getNumberOfColumns() {
     return columns.size();
   }
+
+  public TupleMetadata buildSchema(SchemaBuilder builder) {
+    for(ColumnDto column : columns) {
+      if(column.getColumnType() == PcapTypes.BOOLEAN) {
+        builder.addNullable(column.getColumnName(), TypeProtos.MinorType.BIT);
+      } else if(column.getColumnType() == PcapTypes.INTEGER) {
+        builder.addNullable(column.getColumnName(), TypeProtos.MinorType.INT);
+      } else if(column.getColumnType() == PcapTypes.STRING) {
+        builder.addNullable(column.getColumnName(), TypeProtos.MinorType.VARCHAR);
+      } else if(column.getColumnType() == PcapTypes.TIMESTAMP) {
+        builder.addNullable(column.getColumnName(), TypeProtos.MinorType.TIMESTAMP);
+      } else if(column.getColumnType() == PcapTypes.LONG) {
+        builder.addNullable(column.getColumnName(), TypeProtos.MinorType.BIGINT);
+      }
+    }
+
+    TupleMetadata schema = builder.buildSchema();
+    return schema;
 
 Review comment:
   Nit: `return builder.buildSchema();`

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


With regards,
Apache Git Services