[jira] [Assigned] (AVRO-2509) Avro schema default value to null, should it be "null" (with quotes) or null (without quotes)?

2019-08-16 Thread Brian Lachniet (JIRA)


 [ 
https://issues.apache.org/jira/browse/AVRO-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brian Lachniet reassigned AVRO-2509:


Assignee: Brian Lachniet

> Avro schema default value to null, should it be "null" (with quotes) or null 
> (without quotes)?
> --
>
> Key: AVRO-2509
> URL: https://issues.apache.org/jira/browse/AVRO-2509
> Project: Apache Avro
>  Issue Type: Task
>  Components: java
>Reporter: KT
>Assignee: Brian Lachniet
>Priority: Trivial
>
> HI,  
>    I am new to Avro and trying to define a schema. Wondering if I am trying 
> to default a value to null, should it be: 
>    a. "default": null
>    b. "default": "null"
>    Does it matter what the data type is? like for int then the default will 
> be "default": null, but when it's for a string then the default should be 
> "default":"null"? or it doesn't matter? 
>  
> Thanks
> KT



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (AVRO-2509) Avro schema default value to null, should it be "null" (with quotes) or null (without quotes)?

2019-08-16 Thread Brian Lachniet (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-2509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16909473#comment-16909473
 ] 

Brian Lachniet commented on AVRO-2509:
--

Hi [~kt_hk]!

I'm guessing that you posted [this question on Stack 
Overflow|https://stackoverflow.com/q/57520685/389899] as well. I've copied my 
answer from there:

To default a value to null, you must specify {{"default": null}}. See the table 
in the [Complex 
Types|http://avro.apache.org/docs/1.9.0/spec.html#schema_complex]section of the 
specification for examples values of each type.
{quote}Does it matter what the data type is?
{quote}
*Yes*, the type matters. As you can see in the [Primitive 
Types|http://avro.apache.org/docs/1.9.0/spec.html#schema_primitive] section of 
the specification, {{null}} is its own type. You may not set an {{int}}, 
{{string}}, or any other primitive type to {{null}}.

If you want a "nullable" field, use 
[Unions|http://avro.apache.org/docs/1.9.0/spec.html#Unions]. For example:

{{{ "type": ["null", "int"], "default": null }}}

This dictates that this data may either be an {{int}} or it may be a {{null}}. 
It defaults to {{null}}. When specifying defaults for unions, remember that the 
default must match the first type in the union.

From [the specification|http://avro.apache.org/docs/1.9.0/spec.html#Unions]:
{quote}(Note that when a default value is specified for a record field whose 
type is a union, the type of the default value must match the first element of 
the union. Thus, for unions containing "null", the "null" is usually listed 
first, since the default value of such unions is typically null.)
{quote}

> Avro schema default value to null, should it be "null" (with quotes) or null 
> (without quotes)?
> --
>
> Key: AVRO-2509
> URL: https://issues.apache.org/jira/browse/AVRO-2509
> Project: Apache Avro
>  Issue Type: Task
>  Components: java
>Reporter: KT
>Priority: Trivial
>
> HI,  
>    I am new to Avro and trying to define a schema. Wondering if I am trying 
> to default a value to null, should it be: 
>    a. "default": null
>    b. "default": "null"
>    Does it matter what the data type is? like for int then the default will 
> be "default": null, but when it's for a string then the default should be 
> "default":"null"? or it doesn't matter? 
>  
> Thanks
> KT



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (AVRO-2494) Introduce JSHint for linting the JavaScript bindings

2019-08-16 Thread Hudson (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-2494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16909360#comment-16909360
 ] 

Hudson commented on AVRO-2494:
--

SUCCESS: Integrated in Jenkins build AvroJava #721 (See 
[https://builds.apache.org/job/AvroJava/721/])
AVRO-2494: Introduce JSHint for linting the JavaScript bindings (dan: 
[https://github.com/apache/avro/commit/9b0c88cc6e9a4405d5731ddeda3ed831206e486c])
* (edit) lang/js/lib/protocols.js
* (edit) lang/js/lib/utils.js
* (edit) lang/js/lib/schemas.js
* (edit) lang/js/package.json
* (edit) lang/js/build.sh


> Introduce JSHint for linting the JavaScript bindings
> 
>
> Key: AVRO-2494
> URL: https://issues.apache.org/jira/browse/AVRO-2494
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: javascript
>Reporter: Kengo Seki
>Assignee: Kengo Seki
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (AVRO-2479) Add m2e lifecycle mapping file

2019-08-16 Thread Hudson (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-2479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16909358#comment-16909358
 ] 

Hudson commented on AVRO-2479:
--

SUCCESS: Integrated in Jenkins build AvroJava #721 (See 
[https://builds.apache.org/job/AvroJava/721/])
AVRO-2479: Add m2e lifecycle mapping file for maven (dan: 
[https://github.com/apache/avro/commit/4d324431edf34fc24373829a0d0af95235e6acc3])
* (add) 
lang/java/maven-plugin/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml


> Add m2e lifecycle mapping file
> --
>
> Key: AVRO-2479
> URL: https://issues.apache.org/jira/browse/AVRO-2479
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Reporter: Pino Silvaggio
>Assignee: Daniel Kulp
>Priority: Trivial
> Fix For: 1.9.1
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Instead of including the lifecycle plugin in the pom with the correct 
> mappings we could just add the file by default.
> I suggest enabling build on configuration.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (AVRO-2497) Avro-grpc failed when spotless:check alone

2019-08-16 Thread Hudson (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-2497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16909359#comment-16909359
 ] 

Hudson commented on AVRO-2497:
--

SUCCESS: Integrated in Jenkins build AvroJava #721 (See 
[https://builds.apache.org/job/AvroJava/721/])
AVRO-2497: Avro-grpc failed when spotless:check alone (dan: 
[https://github.com/apache/avro/commit/26f59018800bd88dd58fb84cdaf04860e1b47a54])
* (edit) pom.xml


> Avro-grpc failed when spotless:check alone
> --
>
> Key: AVRO-2497
> URL: https://issues.apache.org/jira/browse/AVRO-2497
> Project: Apache Avro
>  Issue Type: Test
>  Components: java
>Affects Versions: 1.9.0
> Environment: jkd-8
> maven-3.3.9
>Reporter: Smart Yang
>Assignee: Kengo Seki
>Priority: Minor
> Fix For: 1.9.1
>
>
> Enter avro-release-1.9.0/lang/java/grpc
> mvn spotless:check
> Result: BUILD FAILURE
> Log: Could not find goal 'check' in plugin 
> org.apache.avro:avro-maven-plugin:1.9.0 among available goals help, 
> idl-protocol, induce, protocol, schema -> [Help 1]
> But the lang/java/ipc other directories don't have this problem.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (AVRO-2494) Introduce JSHint for linting the JavaScript bindings

2019-08-16 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-2494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16909337#comment-16909337
 ] 

ASF subversion and git services commented on AVRO-2494:
---

Commit 9b0c88cc6e9a4405d5731ddeda3ed831206e486c in avro's branch 
refs/heads/master from Kengo Seki
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=9b0c88c ]

AVRO-2494: Introduce JSHint for linting the JavaScript bindings


> Introduce JSHint for linting the JavaScript bindings
> 
>
> Key: AVRO-2494
> URL: https://issues.apache.org/jira/browse/AVRO-2494
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: javascript
>Reporter: Kengo Seki
>Assignee: Kengo Seki
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Updated] (AVRO-2497) Avro-grpc failed when spotless:check alone

2019-08-16 Thread Daniel Kulp (JIRA)


 [ 
https://issues.apache.org/jira/browse/AVRO-2497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp updated AVRO-2497:
--
   Resolution: Fixed
Fix Version/s: 1.9.1
   Status: Resolved  (was: Patch Available)

> Avro-grpc failed when spotless:check alone
> --
>
> Key: AVRO-2497
> URL: https://issues.apache.org/jira/browse/AVRO-2497
> Project: Apache Avro
>  Issue Type: Test
>  Components: java
>Affects Versions: 1.9.0
> Environment: jkd-8
> maven-3.3.9
>Reporter: Smart Yang
>Assignee: Kengo Seki
>Priority: Minor
> Fix For: 1.9.1
>
>
> Enter avro-release-1.9.0/lang/java/grpc
> mvn spotless:check
> Result: BUILD FAILURE
> Log: Could not find goal 'check' in plugin 
> org.apache.avro:avro-maven-plugin:1.9.0 among available goals help, 
> idl-protocol, induce, protocol, schema -> [Help 1]
> But the lang/java/ipc other directories don't have this problem.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (AVRO-2497) Avro-grpc failed when spotless:check alone

2019-08-16 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-2497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16909321#comment-16909321
 ] 

ASF subversion and git services commented on AVRO-2497:
---

Commit 958538971ecae4a31cec18c774bc273fe584c34b in avro's branch 
refs/heads/branch-1.9 from Kengo Seki
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=9585389 ]

AVRO-2497: Avro-grpc failed when spotless:check alone

(cherry picked from commit 26f59018800bd88dd58fb84cdaf04860e1b47a54)


> Avro-grpc failed when spotless:check alone
> --
>
> Key: AVRO-2497
> URL: https://issues.apache.org/jira/browse/AVRO-2497
> Project: Apache Avro
>  Issue Type: Test
>  Components: java
>Affects Versions: 1.9.0
> Environment: jkd-8
> maven-3.3.9
>Reporter: Smart Yang
>Assignee: Kengo Seki
>Priority: Minor
>
> Enter avro-release-1.9.0/lang/java/grpc
> mvn spotless:check
> Result: BUILD FAILURE
> Log: Could not find goal 'check' in plugin 
> org.apache.avro:avro-maven-plugin:1.9.0 among available goals help, 
> idl-protocol, induce, protocol, schema -> [Help 1]
> But the lang/java/ipc other directories don't have this problem.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (AVRO-2497) Avro-grpc failed when spotless:check alone

2019-08-16 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-2497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16909320#comment-16909320
 ] 

ASF subversion and git services commented on AVRO-2497:
---

Commit 26f59018800bd88dd58fb84cdaf04860e1b47a54 in avro's branch 
refs/heads/master from Kengo Seki
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=26f5901 ]

AVRO-2497: Avro-grpc failed when spotless:check alone


> Avro-grpc failed when spotless:check alone
> --
>
> Key: AVRO-2497
> URL: https://issues.apache.org/jira/browse/AVRO-2497
> Project: Apache Avro
>  Issue Type: Test
>  Components: java
>Affects Versions: 1.9.0
> Environment: jkd-8
> maven-3.3.9
>Reporter: Smart Yang
>Assignee: Kengo Seki
>Priority: Minor
>
> Enter avro-release-1.9.0/lang/java/grpc
> mvn spotless:check
> Result: BUILD FAILURE
> Log: Could not find goal 'check' in plugin 
> org.apache.avro:avro-maven-plugin:1.9.0 among available goals help, 
> idl-protocol, induce, protocol, schema -> [Help 1]
> But the lang/java/ipc other directories don't have this problem.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (AVRO-2479) Add m2e lifecycle mapping file

2019-08-16 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-2479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16909318#comment-16909318
 ] 

ASF subversion and git services commented on AVRO-2479:
---

Commit e774dbd7200214ee297bcdadd32ad8f7c16e4046 in avro's branch 
refs/heads/branch-1.9 from p2
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=e774dbd ]

AVRO-2479: Add m2e lifecycle mapping file for maven

Permit building on configuration but not on incremental.

(cherry picked from commit 4d324431edf34fc24373829a0d0af95235e6acc3)


> Add m2e lifecycle mapping file
> --
>
> Key: AVRO-2479
> URL: https://issues.apache.org/jira/browse/AVRO-2479
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Reporter: Pino Silvaggio
>Priority: Trivial
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Instead of including the lifecycle plugin in the pom with the correct 
> mappings we could just add the file by default.
> I suggest enabling build on configuration.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Resolved] (AVRO-2479) Add m2e lifecycle mapping file

2019-08-16 Thread Daniel Kulp (JIRA)


 [ 
https://issues.apache.org/jira/browse/AVRO-2479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Kulp resolved AVRO-2479.
---
   Resolution: Fixed
 Assignee: Daniel Kulp
Fix Version/s: 1.9.1

> Add m2e lifecycle mapping file
> --
>
> Key: AVRO-2479
> URL: https://issues.apache.org/jira/browse/AVRO-2479
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Reporter: Pino Silvaggio
>Assignee: Daniel Kulp
>Priority: Trivial
> Fix For: 1.9.1
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Instead of including the lifecycle plugin in the pom with the correct 
> mappings we could just add the file by default.
> I suggest enabling build on configuration.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (AVRO-2479) Add m2e lifecycle mapping file

2019-08-16 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-2479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16909317#comment-16909317
 ] 

ASF subversion and git services commented on AVRO-2479:
---

Commit 4d324431edf34fc24373829a0d0af95235e6acc3 in avro's branch 
refs/heads/master from p2
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=4d32443 ]

AVRO-2479: Add m2e lifecycle mapping file for maven

Permit building on configuration but not on incremental.


> Add m2e lifecycle mapping file
> --
>
> Key: AVRO-2479
> URL: https://issues.apache.org/jira/browse/AVRO-2479
> Project: Apache Avro
>  Issue Type: Improvement
>  Components: java
>Reporter: Pino Silvaggio
>Priority: Trivial
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> Instead of including the lifecycle plugin in the pom with the correct 
> mappings we could just add the file by default.
> I suggest enabling build on configuration.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Commented] (AVRO-2493) Unable to register Logical Type for custom Conversion class

2019-08-16 Thread Travis Yocum (JIRA)


[ 
https://issues.apache.org/jira/browse/AVRO-2493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16909074#comment-16909074
 ] 

Travis Yocum commented on AVRO-2493:


Hopefully. I hadn't seen the PR until after I created this issue and I'm the 
person that made the comments on your PR.

> Unable to register Logical Type for custom Conversion class
> ---
>
> Key: AVRO-2493
> URL: https://issues.apache.org/jira/browse/AVRO-2493
> Project: Apache Avro
>  Issue Type: Bug
>  Components: java, logical types
>Affects Versions: 1.9.0
>Reporter: Travis Yocum
>Priority: Major
>
> I have created a custom conversion class for Java's (1.8) 
> java.time.OffsetDateTime.
> {code:java}
> public class OffsetDateTimeConversion extends Conversion {
> private static final DateTimeFormatter DATE_TIME_FORMATTER = 
> DateTimeFormatter.ofPattern("-MM-dd'T'HH:mm:ss.nnZ");
> @Override
> public Class getConvertedType() {
> return OffsetDateTime.class;
> }
> @Override
> public String getLogicalTypeName() {
> return "offset-date-time";
> }
> @Override
> public OffsetDateTime fromCharSequence(CharSequence value, Schema schema, 
> LogicalType type) {
> return OffsetDateTime.parse(value, DATE_TIME_FORMATTER);
> }
> @Override
> public CharSequence toCharSequence(OffsetDateTime value, Schema schema, 
> LogicalType type) {
> return value.format(DATE_TIME_FORMATTER);
> }
> }
> {code}
>  And my simple schema to test (including a field that uses the built-in 
> "time-millis" converter in Avro 1.9 for testing purposes):
> TimeTest.avsc
>  
> {code:java}
> {
>"type": "record",
>"name": "TimeTest",
>"namespace": "time.test",
>"fields": [
>   {
>"name": "createTime",
>"type": {
>"type": "int",
>"logicalType": "time-millis"
>}
>   },
>   {
>"name": "createDateTime",
>"type": {
>"type": "string",
>"logicalType": "offset-date-time"
>}
>   }
>]
> }
> {code}
>  
> I've also created a LogicalType for my conversion field that I need to 
> register:
>  
> {code:java}
> public class OffsetDateTimeLogicalType extends LogicalType {
> public static final String LOGICAL_DATE_TIME_NAME = "offset-date-time";
> public OffsetDateTimeLogicalType() {
> super(LOGICAL_DATE_TIME_NAME);
> }
> @Override
> public void validate(Schema schema) {
> super.validate(schema);
> if (schema.getType() != Schema.Type.STRING) {
> throw new IllegalArgumentException("Logical type 
> 'offset-date-time' must be of type string");
> }
> }
> }{code}
>  
> I've been debugging the avro-maven-plugin and have been able to pinpoint 
> where my issue is occurring while parsing the schema:
>  
> {code:java}
> // parse logical type if present
> result.logicalType = LogicalTypes.fromSchemaIgnoreInvalid(result);
> {code}
>  
> The schema's "logicalType" property is being set to null because it's not a 
> registered logical type.
> The code I need to execute is:
>  
> {code:java}
> LogicalTypes.register(getLogicalTypeName(), schema -> new 
> OffsetDateTimeLogicalType());
> {code}
> Without modifying the plugin code, I see no way to execute this register so 
> that the Schema.parse method (which is called before the conversion class is 
> executed) will recognize this LogicalType.
>  
> The plugin has a config property  to allow for 
> registering the Decimal logical types but nothing to enable other logical 
> types.
> Am I missing something or is this a real issue?



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)


[jira] [Created] (AVRO-2509) Avro schema default value to null, should it be "null" (with quotes) or null (without quotes)?

2019-08-16 Thread KT (JIRA)
KT created AVRO-2509:


 Summary: Avro schema default value to null, should it be "null" 
(with quotes) or null (without quotes)?
 Key: AVRO-2509
 URL: https://issues.apache.org/jira/browse/AVRO-2509
 Project: Apache Avro
  Issue Type: Task
  Components: java
Reporter: KT


HI,  

   I am new to Avro and trying to define a schema. Wondering if I am trying to 
default a value to null, should it be: 

   a. "default": null

   b. "default": "null"

   Does it matter what the data type is? like for int then the default will be 
"default": null, but when it's for a string then the default should be 
"default":"null"? or it doesn't matter? 

 

Thanks

KT



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)