[
https://issues.apache.org/jira/browse/AVRO-2211?focusedWorklogId=751990&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-751990
]
ASF GitHub Bot logged work on AVRO-2211:
----------------------------------------
Author: ASF GitHub Bot
Created on: 02/Apr/22 21:06
Start Date: 02/Apr/22 21:06
Worklog Time Spent: 10m
Work Description: yanivru commented on a change in pull request #1597:
URL: https://github.com/apache/avro/pull/1597#discussion_r841119396
##########
File path: lang/csharp/src/apache/test/Schema/SchemaTests.cs
##########
@@ -417,6 +595,19 @@ public void TestFixedDoc(string s, string expectedDoc)
Assert.AreEqual(expectedDoc, fs.Documentation);
}
+ [TestCase]
+ public void TestFixedCreation()
+ {
+ string s =
@"{""type"":""fixed"",""name"":""fixedName"",""namespace"":""space"",""aliases"":[""space.fixedOldName""],""size"":10}";
+
+ FixedSchema fixedSchema = FixedSchema.Create("fixedName", 10,
"space", new[] { "fixedOldName" }, null);
+
+ Assert.AreEqual("fixedName", fixedSchema.Name);
+ Assert.AreEqual("space.fixedName", fixedSchema.Fullname);
+ Assert.AreEqual(10, fixedSchema.Size);
+ Assert.AreEqual(s, fixedSchema.ToString());
+ }
+
Review comment:
Just noticed there already is a CreateMap in MapSchema type. So I will
remove the create. It's not consistent with other schema types (which has
Create). But writing the type each time seems redundant, so leaving them
"Create" (Seems like MapSchema is not consistent in other areas, like exception
types). What do you think?
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 751990)
Time Spent: 3h 40m (was: 3.5h)
> SchemaBuilder equivalent or other means of schema creation
> ----------------------------------------------------------
>
> Key: AVRO-2211
> URL: https://issues.apache.org/jira/browse/AVRO-2211
> Project: Apache Avro
> Issue Type: Wish
> Components: csharp
> Reporter: Dan Stelljes
> Priority: Major
> Labels: pull-request-available
> Time Spent: 3h 40m
> Remaining Estimate: 0h
>
> Currently, the only way to create a schema is via the Schema.Parse method.
> We'd like to be able to build a schema programmatically—would it be possible
> to (1) introduce an analogue to the SchemaBuilder from the Java library or
> (2) expose constructors on Schema and its descendants?
> Would be more than happy to contribute work on this given some direction.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)