dongjoon-hyun commented on code in PR #1305:
URL: https://github.com/apache/orc/pull/1305#discussion_r1014771172


##########
java/core/src/java/org/apache/orc/OrcUtils.java:
##########
@@ -345,27 +344,27 @@ TypeDescription 
convertTypeFromProtobuf(List<OrcProto.Type> types,
             convertTypeFromProtobuf(types, type.getSubtypes(1)));
         break;
       case STRUCT: {
-          result = TypeDescription.createStruct();
-          for(int f=0; f < type.getSubtypesCount(); ++f) {
-            String name = type.getFieldNames(f);
-            name = name.startsWith("`") ? name : "`" + name + "`";
-            String fieldName = ParserUtils.parseName(new 
ParserUtils.StringPosition(name));
-            result.addField(fieldName, convertTypeFromProtobuf(types, 
type.getSubtypes(f)));
-          }
+        result = TypeDescription.createStruct();
+        for(int f=0; f < type.getSubtypesCount(); ++f) {
+          String name = type.getFieldNames(f);
+          name = name.startsWith("`") ? name : "`" + name + "`";
+          String fieldName = ParserUtils.parseName(new 
ParserUtils.StringPosition(name));
+          result.addField(fieldName, convertTypeFromProtobuf(types, 
type.getSubtypes(f)));
         }
-        break;
+      }
+      break;
       case UNION: {

Review Comment:
   ditto. 
   ```
   - case UNION: {
   + case UNION:
   ```



##########
java/core/src/java/org/apache/orc/OrcUtils.java:
##########
@@ -318,15 +317,15 @@ TypeDescription 
convertTypeFromProtobuf(List<OrcProto.Type> types,
         result = TypeDescription.createDate();
         break;
       case DECIMAL: {
-          result = TypeDescription.createDecimal();
-          if (type.hasScale()) {
-            result.withScale(type.getScale());
-          }
-          if (type.hasPrecision()) {
-            result.withPrecision(type.getPrecision());
-          }
+        result = TypeDescription.createDecimal();
+        if (type.hasScale()) {
+          result.withScale(type.getScale());
         }
-        break;
+        if (type.hasPrecision()) {
+          result.withPrecision(type.getPrecision());
+        }
+      }
+      break;

Review Comment:
   It seems that I missed this in `main` branch but `break` indentation looks 
weird to me. Shall we remove the extra `{}` instead?
   ```
   - case DECIMAL: {
   + case DECIMAL:
   ```
   - Do you think newly added indentation rule looks insufficient to catch this?



##########
java/core/src/java/org/apache/orc/OrcUtils.java:
##########
@@ -345,27 +344,27 @@ TypeDescription 
convertTypeFromProtobuf(List<OrcProto.Type> types,
             convertTypeFromProtobuf(types, type.getSubtypes(1)));
         break;
       case STRUCT: {
-          result = TypeDescription.createStruct();
-          for(int f=0; f < type.getSubtypesCount(); ++f) {
-            String name = type.getFieldNames(f);
-            name = name.startsWith("`") ? name : "`" + name + "`";
-            String fieldName = ParserUtils.parseName(new 
ParserUtils.StringPosition(name));
-            result.addField(fieldName, convertTypeFromProtobuf(types, 
type.getSubtypes(f)));
-          }
+        result = TypeDescription.createStruct();
+        for(int f=0; f < type.getSubtypesCount(); ++f) {
+          String name = type.getFieldNames(f);
+          name = name.startsWith("`") ? name : "`" + name + "`";
+          String fieldName = ParserUtils.parseName(new 
ParserUtils.StringPosition(name));
+          result.addField(fieldName, convertTypeFromProtobuf(types, 
type.getSubtypes(f)));
         }
-        break;
+      }
+      break;

Review Comment:
   ditto.
   ```
   - case STRUCT: {
   + case STRUCT:
   ```



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to