orc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omalley <...@git.apache.org>
Subject [GitHub] orc pull request #151: ORC-226 Support getWriterId in c++ reader interface
Date Tue, 29 Aug 2017 21:54:02 GMT
Github user omalley commented on a diff in the pull request:

    https://github.com/apache/orc/pull/151#discussion_r135922340
  
    --- Diff: c++/include/orc/Reader.hh ---
    @@ -288,6 +288,17 @@ namespace orc {
         virtual uint64_t getCompressionSize() const = 0;
     
         /**
    +     * Get ID of writer that generated the file.
    +     * Current availiable Orc writers:
    +     * 0 = ORC Java
    +     * 1 = ORC C++
    +     * 2 = Presto
    +     * @param id out parameter for writer id
    +     * @return true if writer id is availiable, false if otherwise
    +     */
    +    virtual bool getWriterId(uint32_t & id) const = 0;
    --- End diff --
    
    Actually, we do have the error stream, but we don't need to use it. I'd prefer not to
use side effects in the parameters, because it is easy to misread in the code.
    
    For the code and most users, the important part is which writer it is if known. Only diagnostic
tools will care about the integer value of unknown ones. How about:
    
        enum WriterId { ORC_JAVA_WRITER, ORC_CPP_WRITER, PRESTO_WRITER, UNKNOWN_WRITER}
    
        class Reader {
        
           WriterId getWriterId();
           /**
             * For unknown writer ids, get the value.
             */
           int getUnknownWriterIdValue();
    



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