You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/11/23 15:54:00 UTC

[jira] [Work logged] (AVRO-3257) IDL: add syntax to create optional fields

     [ https://issues.apache.org/jira/browse/AVRO-3257?focusedWorklogId=685364&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-685364 ]

ASF GitHub Bot logged work on AVRO-3257:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Nov/21 15:53
            Start Date: 23/Nov/21 15:53
    Worklog Time Spent: 10m 
      Work Description: opwvhk opened a new pull request #1411:
URL: https://github.com/apache/avro/pull/1411


   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [X] My PR addresses the following [Avro Jira](https://issues.apache.org/jira/browse/AVRO/) issues and references them in the PR title. For example, "AVRO-1234: My Avro PR"
     - https://issues.apache.org/jira/browse/AVRO-3257
     - ~In case you are adding a dependency, check if the license complies with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).~
   
   ### Tests
   
   - [X] My PR adds the following unit tests ~__OR__ does not need testing for this extremely good reason~:
   -- Adjusted the test input `simple.avdl`, but not the output `simple.avpr` (the result should be identical to the original)
   
   ### Commits
   
   - [x] My commits all reference Jira issues in their subject lines. In addition, my commits follow the guidelines from "[How to write a good git commit message](https://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   **NOTE**: This PR is intended to be merged after PR #1407 for AVRO-3256 (it includes changes required by this PR). To review, please only check the last commit.
   
   ### Documentation
   
   - [X] In case of new functionality, my PR adds documentation that describes how to use it.
     - All the public functions and the classes in the PR contain Javadoc that explain what it does
     - The website documentation has been extended to include the new functionality
   


-- 
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: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 685364)
    Remaining Estimate: 0h
            Time Spent: 10m

> IDL: add syntax to create optional fields
> -----------------------------------------
>
>                 Key: AVRO-3257
>                 URL: https://issues.apache.org/jira/browse/AVRO-3257
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: java, spec
>            Reporter: Oscar Westra van Holthe - Kind
>            Assignee: Oscar Westra van Holthe - Kind
>            Priority: Minor
>              Labels: javacc, pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> To define optional values, Avro has the "union with the null type" construction.
> In IDL, this is a rather verbose construct:
> {code}
> union {null, string} optionalName = null;
> {code}
> Wish: add Kotlin style optional types like this:
> {code}
> string? optionalName = null;
> {code}
> The resulting schema should be identical; it's only a syntax change.
> Note: it would be nice (but not required) if the syntax would also work if the default value is not null:
> {code}
> string? optionalName = "Jane Doe";
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)