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 2022/06/13 14:05:00 UTC
[jira] [Work logged] (AVRO-3404) Extend the IDL syntax to serve as a .avsc equivalent as well
[ https://issues.apache.org/jira/browse/AVRO-3404?focusedWorklogId=780834&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-780834 ]
ASF GitHub Bot logged work on AVRO-3404:
----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Jun/22 14:04
Start Date: 13/Jun/22 14:04
Worklog Time Spent: 10m
Work Description: opwvhk commented on code in PR #1589:
URL: https://github.com/apache/avro/pull/1589#discussion_r895757207
##########
lang/java/idl/src/main/java/org/apache/avro/idl/SchemaVisitorAction.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.avro.idl;
+
+public enum SchemaVisitorAction {
Review Comment:
Actually, it was copied from the `avro-compiler` package. So that's where the naming comes from.
It could be done differently (arguably better), but I chose to keep it as-is as much as possible.
Issue Time Tracking
-------------------
Worklog Id: (was: 780834)
Time Spent: 20m (was: 10m)
> Extend the IDL syntax to serve as a .avsc equivalent as well
> ------------------------------------------------------------
>
> Key: AVRO-3404
> URL: https://issues.apache.org/jira/browse/AVRO-3404
> Project: Apache Avro
> Issue Type: Improvement
> Components: build, dependencies, java
> Reporter: Oscar Westra van Holthe - Kind
> Assignee: Oscar Westra van Holthe - Kind
> Priority: Major
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> The Avro IDL format is not widely adopted, as it yields a protocol (most people use schemas only). To remedy this, I propose to extend the IDL syntax.
> Future IDL files will have two options:
> # Use the existing syntax to define a protocol
> Parsing such a file yields a protocol and a collection of named schemas (that can also be found in the protocol object)
> # Use the syntax below to define a schema
> Parsing such a file yields a collection of named schemas and optionally a "main schema", which can be a named or an anonymous schema.
> Proposed syntax:
> {code:none}
> // Optional: the default namespace for the whole file (defaults to the null namespace if omitted)
> // (in the existing syntax, the namespace of the protocol has the same function)
> namespace my.name.space;
> // Optional: a main schema to parse the file as a .avsc equivalent
> schema array<Message>;
> // Below here are imports and named schemas in any order
> /* Import rules for the new syntax:
> - the namespace of the imported named types is determined by the imported file
> (same as for the existing syntax)
> - when importing idl or protocol files, only the named schemas are imported
> (as this syntax supports only these)
> */
> import idl "common.avdl";
> /**
> * A message to communicate.
> */
> record Message {
> array<Header> headers;
> string? title = null; // Idea: add null as default value, unless there's an explicit default value
> string message;
> timestamp_ms sendTime;
> }
> {code}
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)