You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/05/22 05:09:02 UTC

[GitHub] [arrow] tianchen92 commented on a change in pull request #7231: ARROW-6839: [Java] Add APIs to read and write "custom_metadata" field of IPC file footer

tianchen92 commented on a change in pull request #7231:
URL: https://github.com/apache/arrow/pull/7231#discussion_r429044815



##########
File path: java/vector/src/test/java/org/apache/arrow/vector/ipc/TestArrowReaderWriter.java
##########
@@ -751,4 +753,52 @@ public void testChannelReadFullyEos() throws IOException {
       assertEquals(10, arrBuf.getInt(0));
     }
   }
+
+  @Test
+  public void testCustomMetaData() throws IOException {
+    DictionaryProvider.MapDictionaryProvider provider = new DictionaryProvider.MapDictionaryProvider();
+    provider.put(dictionary1);
+
+    VarCharVector vector1 = newVarCharVector("varchar1", allocator);
+    vector1.allocateNewSafe();
+    vector1.set(0, "foo".getBytes(StandardCharsets.UTF_8));
+    vector1.set(1, "bar".getBytes(StandardCharsets.UTF_8));
+    vector1.set(3, "baz".getBytes(StandardCharsets.UTF_8));
+    vector1.set(4, "bar".getBytes(StandardCharsets.UTF_8));
+    vector1.set(5, "baz".getBytes(StandardCharsets.UTF_8));
+    vector1.setValueCount(6);
+    FieldVector encodedVector1 = (FieldVector) DictionaryEncoder.encode(vector1, dictionary1);

Review comment:
       >is dictionary encoding really necessary for this test?
   
   Not necessary, removed, thanks.
   
   >Can you use the VectorPopulator is any data is actually needed?
   
   Hmm, always forget this, fixed.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org