Apache Drill
  1. Apache Drill
  2. DRILL-362

Some protobuf enum values generates problematic C++/Windows code

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      The enums DataMode and MinorType (in Types.proto) each contain a value (OPTIONAL and NULL respectively) that generate into problematic C++ code on Windows under Visual Studio.

      I propose to add a prefix to the enum values to uniquify them. For example:

      enum DataMode

      { DM_OPTIONAL = 0, DM_REQUIRED = 1, DM_REPEATED = 2 }

      This is slightly ugly but is ultimately safe. Unfortunately, this change will trigger a lot of little changes throughout the codebase.

        Issue Links

          Activity

          George Chow created issue -
          Hide
          Timothy Chen added a comment -

          The joy of enums in C++... I think it's fine but it does touches lots of places so the refactor will probably require some testing to make sure things still work, especially the generate code templates as they might not be able to get refactored automatically by any IDE.

          Show
          Timothy Chen added a comment - The joy of enums in C++... I think it's fine but it does touches lots of places so the refactor will probably require some testing to make sure things still work, especially the generate code templates as they might not be able to get refactored automatically by any IDE.
          George Chow made changes -
          Field Original Value New Value
          Link This issue relates to DRILL-371 [ DRILL-371 ]
          Hide
          Jacques Nadeau added a comment -

          I don't think we need to change the proto files. You could simply apply a filter to the proto files before generating your C code. No reason to change the Java code since proto is a wire format.

          Show
          Jacques Nadeau added a comment - I don't think we need to change the proto files. You could simply apply a filter to the proto files before generating your C code. No reason to change the Java code since proto is a wire format.

            People

            • Assignee:
              Unassigned
              Reporter:
              George Chow
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Development