Re: Add datastore for Elasticsearch. Outreachy Week 8 Report

2021-01-31 Thread Maria Podorvanova
Hi John,

Thank you for your feedback.

I am back from my small holiday and will address your comment this week.

Regards,
Maria

On Thu, 28 Jan 2021 at 03:41, John Mora  wrote:

> Hi María.
>
> Thanks for your report.
>
> Some comments.
>
> When a Key is not found in the Datastore the get method should return
>  null, but currently a NullPointerException is thrown here:
>
>
> https://github.com/podorvanova/gora/blob/gora-664/gora-elasticsearch/src/main/java/org/apache/gora/elasticsearch/store/ElasticsearchStore.java#L256
>
> According to the avro documentation: "This data type is used to declare a
> fixed-sized field that can be used for storing binary data.", it is similar
> to the BYTES data type, but it has a size attribute.
>
> If Elasticsearch has a fixed-sized binary datatype you can use it. But, I
> think that is not the case, so If other modules do not implement it, it is
> fine to leave it that way.
>
> Best,
> John
>
> El dom, 24 ene 2021 a las 8:16, Maria Podorvanova (<
> podorvanova.ma...@gmail.com>) escribió:
>
>> Hi,
>>
>> Report #8
>> Period: January, 17 - January, 23
>> Activities:
>> - Fix createSchema method [1]
>>
>>1. Added the index mappings while creating the Elasticsearch index
>>2. Added getter and setter to enum Datatype
>>
>> - Implement serialization/deserialization for some Avro data types [2]
>>
>>1. Implemented serializeFieldValue and deserializeFieldValue methods
>>for ARRAY BOOLEAN, BYTES and FIXED Avro data types
>>2. Fixed deserialization for STRING Avro data type
>>3. Added javadoc descriptions
>>
>> - The following tests are passing now:
>>
>>1. testCreateSchema, testAutoCreateSchema for createSchema method
>>2. testSchemaExists
>>3. testPut
>>4. testGet
>>
>> - Wrote a blog post #4
>>
>> Here are links to the commits:
>> [1]
>> https://github.com/podorvanova/gora/commit/6b9c21095fa4e9327328ec881b659c60c58c4941
>> [2]
>> https://github.com/podorvanova/gora/commit/e459309b3f750af65a181d4904470eaee9c29a2e
>>
>> Question:
>> I didn't quite understand what kind of type is represented by FIXED Avro
>> data type. I looked through other modules and found that FIXED case is not
>> being processed neither in serialization nor in deserialization, so I did
>> the same for now.
>>
>> Regards,
>> Maria
>>
>


Re: Outreachy 2020-2021 - Neo4j - Weekly reports.

2021-01-31 Thread gabriela ortiz
Hi all.

I wanted to inform the tasks I worked on this week: Jan 17 - Jan 29 .

* Add suggested javadocs.
* Add suggested constants.
* Make EXIST constraints optional.
* Activate tests:
testNewInstance
testAutoCreateSchema
testPut
testBenchmarkExists
testGetNonExisting
testObjectFieldValue
* Write a blog (Career opportunities)

My code is here: https://github.com/mgov88/gora/tree/GORA-663

Regards,
Gaby


El mié, 27 de ene. de 2021 a la(s) 12:00, John Mora (jhnmora...@gmail.com)
escribió:

> Hi Gaby
>
> Thanks for your report.
>
> Some comments:
>
> Please use constants instead of literal values here:
>
> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L204
>
> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L224
>
> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L251
>
> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L341
>
> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L284
>
> Add javadocs here:
>
> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L278
>
> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L388
>
> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L431
>
> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L487
>
> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L500
>
> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L507
>
> Regarding the EXISTS constraint: IMHO that is a good approach, but let's
> make this attribute optional in the mapping and default: false.
>
> Regards,
> John
>
> El lun, 25 ene 2021 a las 18:32, gabriela ortiz ()
> escribió:
>
>> Hi all.
>>
>> I wanted to inform the tasks I worked on this week: Jan 16 - Jan 22 .
>>
>> - Add EXISTS constraints for properties.
>> - Develop put method.
>> - Enable test of the put & get methods.
>> - Switch to fixed version docker image 'neo4j:4.2.2-enterprise' instead
>> of 'enterprise' tag.
>>
>> My code is here: https://github.com/mgov88/gora/tree/GORA-663
>>
>> I have a question, in Neo4j the null value represent the absence of the
>> property/relation:
>>
>> "In Neo4j, since there is no table schema or equivalent to restrict
>> possible properties, non-existence and null are equivalent for node and
>> relationship properties. That is, there really is no such thing as a
>> property with a null value; null indicates that the property doesn’t exist
>> at all."
>>
>>
>> https://neo4j.com/developer/kb/understanding-non-existent-properties-and-null-values/
>>
>> I added an attribute in the mapping file to specify if the EXISTS
>> constraint should be applied, because in the tests sometimes the field
>> values are null and there are conflicts with this constraint.
>>
>>
>> https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/test/resources/gora-neo4j-mapping.xml#L22
>>
>> Is it correct this way?
>>
>> Regardss
>> Gaby
>>
>> El lun, 18 de ene. de 2021 a la(s) 22:58, gabriela ortiz (
>> arqgabyor...@gmail.com) escribió:
>>
>>> Hi
>>>
>>> Thanks for your comments. I am working on them.
>>>
>>> Best regards,
>>> Gaby
>>>
>>> El lun, 18 de ene. de 2021 a la(s) 17:11, John Mora (
>>> jhnmora...@gmail.com) escribió:
>>>
 Hi Gaby.

 Thanks for your update.

 Some comments.


 https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/store/Neo4jStore.java#L156

 Please create EXISTS constraints for the other properties of the Node
 as well.


 https://neo4j.com/docs/cypher-manual/current/administration/constraints/#administration-constraints-prop-exist-nodes

 You can use the mapping parsed from the XML.


 https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/main/java/org/apache/gora/neo4j/mapping/Neo4jMapping.java#L38

 Please use a specific docker image tag of Neo4j instead of the 'latest'
 or 'enterprise'


 https://github.com/mgov88/gora/blob/GORA-663/gora-neo4j/src/test/java/org/apache/gora/neo4j/GoraNeo4jTestDriver.java#L60

 This might break the code when a new version of Neo4j is released.

 Regards,
 John

 El dom, 17 ene 2021 a las 14:39, gabriela ortiz (<
 arqgabyor...@gmail.com>) escribió:

> Hi all.
>
> I wanted to inform the tasks I worked on this week: Jan 09 - Jan 15 .
>
> - Enhance the javadocs