drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacques-n <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-4006: Ensure the position of MapWriters ...
Date Tue, 03 Nov 2015 17:16:26 GMT
Github user jacques-n commented on a diff in the pull request:

    https://github.com/apache/drill/pull/233#discussion_r43777175
  
    --- Diff: exec/java-exec/src/main/codegen/templates/MapWriters.java ---
    @@ -110,9 +110,9 @@ public ListWriter list(String name) {
         FieldWriter writer = fields.get(name.toLowerCase());
         if(writer == null) {
           writer = new SingleListWriter(name, container, this);
    -      writer.setPosition(${index});
           fields.put(name.toLowerCase(), writer);
         }
    +    writer.setPosition(${index});
    --- End diff --
    
    Your change seems to violate the design pattern of the writers. Position is managed via
the setPosition call at line 152. If you're seeing problems, you should figure who isn't calling
that method. I believe the code before your change is correct: the only reason we should have
to reposition a writer when we retrieve it is it didn't previously exist and we had to create
a new one. This is the pattern used across the board for position in the context of all the
writers. Position is managed externally and only a new field creation should cause a location
position set.


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