drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill pull request #851: DRILL-5518: Test framework enhancements
Date Wed, 21 Jun 2017 23:42:14 GMT
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/851#discussion_r123140150
  
    --- Diff: exec/java-exec/src/test/java/org/apache/drill/test/rowSet/SchemaBuilder.java
---
    @@ -96,27 +137,57 @@ public SchemaBuilder withSVMode(SelectionVectorMode svMode) {
     
       public SchemaBuilder() { }
     
    +  public SchemaBuilder(BatchSchema baseSchema) {
    +    for (MaterializedField field : baseSchema) {
    +      columns.add(field);
    +    }
    +  }
    +
       public SchemaBuilder add(String pathName, MajorType type) {
    -    MaterializedField col = MaterializedField.create(pathName, type);
    +    return add(MaterializedField.create(pathName, type));
    +  }
    +
    +  public SchemaBuilder add(MaterializedField col) {
         columns.add(col);
         return this;
       }
     
    +  public static MaterializedField columnSchema(String pathName, MinorType type, DataMode
mode) {
    +    return MaterializedField.create(pathName,
    +        MajorType.newBuilder()
    --- End diff --
    
    Just saving an unnecessary object creation. The schema builder is for cases where we set
more than the "basic three" properties. This method handles the vast majority of the cases
in which we use just the "basic three".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message