[
https://issues.apache.org/jira/browse/GORA-265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Apostolos Giannakidis updated GORA-265:
---------------------------------------
Description:
Currently, the GoraCompiler is able to compile avro schemas with 2 ways:
1) specify the file directly. This way the GoraCompiler will generate data
beans based on the specified avro scheme. For example: bin/gora goracompiler
gora-core/src/examples/avro/webpage.json gora-core/src/examples/java.
2) specify a directory. This way the GoraCompiler will generate data beans
based on all the avro schemes which are inside the specified directory. For
example: bin/gora goracompiler gora-core/src/examples/avro/
gora-core/src/examples/java
Note:
* in the 1st case, the user can specify ANY file extension. It could be
webpage.json or webpage.avsc or webpage.foo.
* in the 2nd case, the user specifies the directory BUT ONLY the files with
extension .avsc will be processed.
Also note that the example avro schemes that are distributed with the current
Gora release have .json extension. So, if a user executes:
bin/gora goracompiler gora-core/src/examples/avro/webpage.json
gora-core/src/examples/java
then no data beans are generated, because the GoraCompiler looks only for .avsc
files. This is clearly counterintuitive.
I suggest to add support so that the default will still be to look only for
.avsc files. However, the user would have the option to specify the extension
he/she wants, by executing the following:
bin/gora goracompiler gora-core/src/examples/avro/*.json
gora-core/src/examples/java.
Note the *.json. This would be dynamic. Therefore, the user could specify and
file extension he/she would like.
What is your opinion? I would appreciate your feedback on this. If you agree, I
can proceed with a patch for this.
was:
Currently, the GoraCompiler is able to compile avro schemas with 2 ways:
1) specify the file directly. This way the GoraCompiler will generate data
beans based on the specified avro scheme. For example: bin/gora goracompiler
gora-core/src/examples/avro/webpage.json gora-core/src/examples/java.
2) specify a directory. This way the GoraCompiler will generate data beans
based on all the avro schemes which are inside the specified directory. For
example: bin/gora goracompiler gora-core/src/examples/avro/
gora-core/src/examples/java
Note:
* in the 1st case, the user can specify ANY file extension. It could be
webpage.json or webpage.avsc or webpage.foo.
* in the 2nd case, the user specifies the directory BUT ONLY the files with
extension .avsc will be processed.
Also note that the example avro schemes that are distributed with the current
Gora release have .json extension. So, if a user executes:
bin/gora goracompiler gora-core/src/examples/avro/webpage.json
gora-core/src/examples/java
then no data beans are generated, because the GoraCompiler looks only for .avsc
files.
I suggest to add support so that the default will still be to look only for
.avsc files. However, the user would have the option to specify the extension
he/she wants, by executing the following:
bin/gora goracompiler gora-core/src/examples/avro/*.json
gora-core/src/examples/java.
Note the *.json. This would be dynamic. Therefore, the user could specify and
file extension he/she would like.
What is your opinion? I would appreciate your feedback on this. If you agree, I
can proceed with a patch for this.
> Support for dynamic file extensions when traversing a directory
> ---------------------------------------------------------------
>
> Key: GORA-265
> URL: https://issues.apache.org/jira/browse/GORA-265
> Project: Apache Gora
> Issue Type: Sub-task
> Components: gora-core
> Affects Versions: 0.3
> Reporter: Apostolos Giannakidis
> Assignee: Apostolos Giannakidis
> Priority: Minor
> Fix For: 0.4
>
>
> Currently, the GoraCompiler is able to compile avro schemas with 2 ways:
> 1) specify the file directly. This way the GoraCompiler will generate data
> beans based on the specified avro scheme. For example: bin/gora goracompiler
> gora-core/src/examples/avro/webpage.json gora-core/src/examples/java.
> 2) specify a directory. This way the GoraCompiler will generate data beans
> based on all the avro schemes which are inside the specified directory. For
> example: bin/gora goracompiler gora-core/src/examples/avro/
> gora-core/src/examples/java
> Note:
> * in the 1st case, the user can specify ANY file extension. It could be
> webpage.json or webpage.avsc or webpage.foo.
> * in the 2nd case, the user specifies the directory BUT ONLY the files with
> extension .avsc will be processed.
> Also note that the example avro schemes that are distributed with the current
> Gora release have .json extension. So, if a user executes:
> bin/gora goracompiler gora-core/src/examples/avro/webpage.json
> gora-core/src/examples/java
> then no data beans are generated, because the GoraCompiler looks only for
> .avsc files. This is clearly counterintuitive.
> I suggest to add support so that the default will still be to look only for
> .avsc files. However, the user would have the option to specify the extension
> he/she wants, by executing the following:
> bin/gora goracompiler gora-core/src/examples/avro/*.json
> gora-core/src/examples/java.
> Note the *.json. This would be dynamic. Therefore, the user could specify and
> file extension he/she would like.
> What is your opinion? I would appreciate your feedback on this. If you agree,
> I can proceed with a patch for this.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira