[jira] [Created] (ARROW-5518) Set VectorSchemaRoot rowCount to 0 on allocateNew and clear
Johannes Luong created ARROW-5518: - Summary: Set VectorSchemaRoot rowCount to 0 on allocateNew and clear Key: ARROW-5518 URL: https://issues.apache.org/jira/browse/ARROW-5518 Project: Apache Arrow Issue Type: Improvement Components: Java Reporter: Johannes Luong Set {{VectorSchemaRoot::rowCount}} to 0 in {{allocateNew()}} and {{clear()}}. This makes the behaviour of {{VectorSchemaRoot}} consistent with {{ValueVector}} implementations which set their {{valueCount}} to 0 on {{clear()}}. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (ARROW-5518) [Java] Set VectorSchemaRoot rowCount to 0 on allocateNew and clear
[ https://issues.apache.org/jira/browse/ARROW-5518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Johannes Luong updated ARROW-5518: -- Summary: [Java] Set VectorSchemaRoot rowCount to 0 on allocateNew and clear (was: Set VectorSchemaRoot rowCount to 0 on allocateNew and clear ) > [Java] Set VectorSchemaRoot rowCount to 0 on allocateNew and clear > --- > > Key: ARROW-5518 > URL: https://issues.apache.org/jira/browse/ARROW-5518 > Project: Apache Arrow > Issue Type: Improvement > Components: Java >Reporter: Johannes Luong >Priority: Minor > Labels: newbie, patch, pull-request-available > > Set {{VectorSchemaRoot::rowCount}} to 0 in {{allocateNew()}} and {{clear()}}. > This makes the behaviour of {{VectorSchemaRoot}} consistent with > {{ValueVector}} implementations which set their {{valueCount}} to 0 on > {{clear()}}. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (ARROW-5518) [Java] set VectorSchemaRoot rowCount to 0 on allocateNew and clear
[ https://issues.apache.org/jira/browse/ARROW-5518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Johannes Luong updated ARROW-5518: -- Summary: [Java] set VectorSchemaRoot rowCount to 0 on allocateNew and clear (was: [Java] Set VectorSchemaRoot rowCount to 0 on allocateNew and clear ) > [Java] set VectorSchemaRoot rowCount to 0 on allocateNew and clear > --- > > Key: ARROW-5518 > URL: https://issues.apache.org/jira/browse/ARROW-5518 > Project: Apache Arrow > Issue Type: Improvement > Components: Java >Reporter: Johannes Luong >Priority: Minor > Labels: newbie, patch, pull-request-available > > Set {{VectorSchemaRoot::rowCount}} to 0 in {{allocateNew()}} and {{clear()}}. > This makes the behaviour of {{VectorSchemaRoot}} consistent with > {{ValueVector}} implementations which set their {{valueCount}} to 0 on > {{clear()}}. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (ARROW-5518) [Java] Set VectorSchemaRoot rowCount to 0 on allocateNew and clear
[ https://issues.apache.org/jira/browse/ARROW-5518?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Johannes Luong updated ARROW-5518: -- Summary: [Java] Set VectorSchemaRoot rowCount to 0 on allocateNew and clear (was: [Java] set VectorSchemaRoot rowCount to 0 on allocateNew and clear ) > [Java] Set VectorSchemaRoot rowCount to 0 on allocateNew and clear > --- > > Key: ARROW-5518 > URL: https://issues.apache.org/jira/browse/ARROW-5518 > Project: Apache Arrow > Issue Type: Improvement > Components: Java >Reporter: Johannes Luong >Priority: Minor > Labels: newbie, patch, pull-request-available > > Set {{VectorSchemaRoot::rowCount}} to 0 in {{allocateNew()}} and {{clear()}}. > This makes the behaviour of {{VectorSchemaRoot}} consistent with > {{ValueVector}} implementations which set their {{valueCount}} to 0 on > {{clear()}}. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (ARROW-5536) [JAVA] Leak in JdbcToArrowUtils
Johannes Luong created ARROW-5536: - Summary: [JAVA] Leak in JdbcToArrowUtils Key: ARROW-5536 URL: https://issues.apache.org/jira/browse/ARROW-5536 Project: Apache Arrow Issue Type: Bug Components: Java Reporter: Johannes Luong Assignee: Johannes Luong {{JdbcToArrowUtils::updateVector(VarCharVector, String, boolean, int)}} does not release the memory that it allocates for the {{NullableVarCharHolder}}. This can be verified by changing the first lines of {{JdbcToArrowTest::testJdbcToArrowValues()}} to the following: {code:java} RootAllocator allocator = new RootAllocator(Integer.MAX_VALUE); VectorSchemaRoot root = JdbcToArrow.sqlToArrow(conn, table.getQuery(), allocator, Calendar.getInstance()); testDataSets(root); root.close(); assertEquals(allocator.getAllocatedMemory(), 0); {code} The leak can be fixed by closing the buffer in {{updateVector}}. However, I would propose to not use the {{NullableVarCharHolder}} in the first place because it creates an unnecessary copy of the string. Instead, I would use {{BaseVariableWidthVector::setSafe(int index, byte[] value)}} and {{BaseVariableWidthVector::setNull(int index)}} directly. In addition, I would propose to check for leaks in JdbcToArrowTest. I am willing to create a patch, so please let me know what approach is preferred. -- This message was sent by Atlassian JIRA (v7.6.3#76005)