[
https://issues.apache.org/jira/browse/AVRO-3427?focusedWorklogId=737546&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-737546
]
ASF GitHub Bot logged work on AVRO-3427:
----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Mar/22 14:46
Start Date: 07/Mar/22 14:46
Worklog Time Spent: 10m
Work Description: kordos commented on pull request #1578:
URL: https://github.com/apache/avro/pull/1578#issuecomment-1060765238
> If the `namspace` field in the schema definition is `foo.bar.ap`, the
directory structure will be `./foo/bar/ap` for that type as of now. Are you
saying that avrogen generates a single `foo.bar.ap` directory? Could you
provide an example schema definition, the generated directory structure and
your expected directory structure here?
>
> Here is my schema:
>
> ```
> {"namespace": "org.apache.avro.codegentest.testdata",
> "type": "record",
> "name": "NestedLogicalTypesRecord",
> "doc" : "Test nested types with logical types in generated Java classes",
> "fields": [
> {
> "name": "nestedRecord",
> "type": {
> "namespace": "org.apache.avro.codegentest.testdata",
> "type": "record",
> "name": "NestedRecord",
> "fields": [
> {
> "name": "nullableDateField",
> "type": ["null", {"type": "int", "logicalType": "date"}]
> }
> ]
> }
> }]
> }
> ```
>
> avrogen will generate the following directory structure:
>
> ```
> ./org/apache/avro/codegentest/testdata/NestedLogicalTypesRecord.cs
> ./org/apache/avro/codegentest/testdata/NestedRecord.cs
> ```
Your example is correct. It creates directory per namespace part. However in
company where I'm working we are using different naming convention. Our naming
convention is to use multi namespace per directory. We fallow SOA and we have
hundreds, maybe even more than thousand of microservices so we won't be able to
change our naming convention.
I'll use your definitions for example but we need slightly different
directory structure, so in my project it should be placed in:
```
./org.apache.avro/codegentest/testdata/NestedLogicalTypesRecord.cs
./org.apache.avro/codegentest/testdata/NestedRecord.cs
```
Avrogen is not handling such cases. it will generate classes in path :
/org/apache/avro/codegentest/testdata/ and not as it should be in my project:
/org.apache.avro/codegentest/testdata/. Just to be clear, namespaces for
generated classes are correct as there is no notion of directory. I hope it
helps
--
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: 737546)
Time Spent: 5h (was: 4h 50m)
> Add command line option to skip creation of directories based on namespace
> path
> -------------------------------------------------------------------------------
>
> Key: AVRO-3427
> URL: https://issues.apache.org/jira/browse/AVRO-3427
> Project: Apache Avro
> Issue Type: Improvement
> Components: csharp
> Affects Versions: 1.11.0
> Reporter: Paweł Kordowski
> Priority: Major
> Labels: pull-request-available
> Time Spent: 5h
> Remaining Estimate: 0h
>
> In java each part of the namespace is a separate directory but that's not the
> case for C#.
> In C# you can have directory name that have many namespaces in it.
> For example:
> {noformat}
> Application.Manager.Api{noformat}
> can be a single directory name. In Java it would be 3 separate directories
> and because of that classes are generated under wrong path. it is placed in:
> {noformat}
> /Application/Manager/Api/{noformat}
> but it should be placed like here:
> {noformat}
> /Application.Manager.Api/{noformat}
> I think the best solution would be to add command line option that would skip
> creation of directories based on namespace and it would just create classes
> directly in pointed directory.
>
> Regards,
> Pawel
--
This message was sent by Atlassian Jira
(v8.20.1#820001)