[ 
https://issues.apache.org/jira/browse/PARQUET-1321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16507856#comment-16507856
 ] 

ASF GitHub Bot commented on PARQUET-1321:
-----------------------------------------

gszadovszky commented on a change in pull request #493: PARQUET-1321: 
LogicalTypeAnnotation.LogicalTypeAnnotationVisitor#visit methods should have a 
return value
URL: https://github.com/apache/parquet-mr/pull/493#discussion_r194342627
 
 

 ##########
 File path: 
parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java
 ##########
 @@ -241,18 +242,13 @@ private void visitChildren(final List<SchemaElement> 
result,
   }
 
   LogicalType convertToLogicalType(LogicalTypeAnnotation 
logicalTypeAnnotation) {
-    LogicalTypeConverterVisitor logicalTypeConverterVisitor = new 
LogicalTypeConverterVisitor();
-    logicalTypeAnnotation.accept(logicalTypeConverterVisitor);
-    return logicalTypeConverterVisitor.logicalType;
+    return logicalTypeAnnotation.accept(new 
LogicalTypeConverterVisitor()).get();
   }
 
   ConvertedType convertToConvertedType(LogicalTypeAnnotation 
logicalTypeAnnotation) {
-    LogicalTypeConverterVisitor logicalTypeConverterVisitor = new 
LogicalTypeConverterVisitor();
-    logicalTypeAnnotation.accept(logicalTypeConverterVisitor);
-    return logicalTypeConverterVisitor.convertedType;
+    return logicalTypeAnnotation.accept(new 
ConvertedTypeConverterVisitor()).get();
 
 Review comment:
   See above.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> LogicalTypeAnnotation.LogicalTypeAnnotationVisitor#visit methods should have 
> a return value
> -------------------------------------------------------------------------------------------
>
>                 Key: PARQUET-1321
>                 URL: https://issues.apache.org/jira/browse/PARQUET-1321
>             Project: Parquet
>          Issue Type: Improvement
>          Components: parquet-mr
>            Reporter: Nandor Kollar
>            Assignee: Nandor Kollar
>            Priority: Major
>
> LogicalTypeAnnotationVisitor inside LogicalTypeAnnotation is intended to be 
> used by clients who would like to execute custom code which depends on the 
> type of the logical type annotation. However, it is difficult to give back 
> any result from the visitor, since both LogicalTypeAnnotation#accept, and 
> LogicalTypeAnnotationVisitor has void return type.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to