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

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_r194342297
 
 

 ##########
 File path: 
parquet-column/src/main/java/org/apache/parquet/schema/LogicalTypeAnnotation.java
 ##########
 @@ -834,45 +838,63 @@ public int hashCode() {
    * The default implementation for each logical type specific visitor method 
is empty.
    * <p>
    * Example usage: logicalTypeAnnotation.accept(new 
LogicalTypeAnnotationVisitor() { ... });
+   *
+   * Every visit method returns {@link Optional#empty()} by default.
+   * It means that for the given logical type no specific action is needed.
+   * Client code can use {@link Optional#orElse(Object)} to return a default 
value for unhandled types,
+   * or {@link Optional#orElseThrow(Supplier)} to throw exception if omitting 
a type is not allowed.
    */
-  public interface LogicalTypeAnnotationVisitor {
-    default void visit(StringLogicalTypeAnnotation logicalTypeAnnotation) {
+  public interface LogicalTypeAnnotationVisitor<T> {
 
 Review comment:
   Thanks for adding the comments. I accept the concept of using Optionals here.

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