You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by lz...@apache.org on 2024/08/28 15:22:26 UTC

(paimon) branch master updated: [arrow] ArrowFormatWriter shouldn't set allowUpperCase=false by default (#4086)

This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new 0228f2368 [arrow] ArrowFormatWriter shouldn't set allowUpperCase=false by default (#4086)
0228f2368 is described below

commit 0228f2368441319240b82389f18ddef4b94a86d3
Author: yuzelin <33...@users.noreply.github.com>
AuthorDate: Wed Aug 28 23:22:21 2024 +0800

    [arrow] ArrowFormatWriter shouldn't set allowUpperCase=false by default (#4086)
---
 .../java/org/apache/paimon/arrow/vector/ArrowFormatCWriter.java   | 4 ++--
 .../java/org/apache/paimon/arrow/vector/ArrowFormatWriter.java    | 4 ++--
 .../org/apache/paimon/arrow/vector/ArrowFormatWriterTest.java     | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/paimon-arrow/src/main/java/org/apache/paimon/arrow/vector/ArrowFormatCWriter.java b/paimon-arrow/src/main/java/org/apache/paimon/arrow/vector/ArrowFormatCWriter.java
index 989019daf..10afcaf69 100644
--- a/paimon-arrow/src/main/java/org/apache/paimon/arrow/vector/ArrowFormatCWriter.java
+++ b/paimon-arrow/src/main/java/org/apache/paimon/arrow/vector/ArrowFormatCWriter.java
@@ -37,8 +37,8 @@ public class ArrowFormatCWriter implements AutoCloseable {
     private final ArrowSchema schema;
     private final ArrowFormatWriter realWriter;
 
-    public ArrowFormatCWriter(RowType rowType, int writeBatchSize) {
-        this.realWriter = new ArrowFormatWriter(rowType, writeBatchSize);
+    public ArrowFormatCWriter(RowType rowType, int writeBatchSize, boolean allowUpperCase) {
+        this.realWriter = new ArrowFormatWriter(rowType, writeBatchSize, allowUpperCase);
         RootAllocator allocator = realWriter.getAllocator();
         array = ArrowArray.allocateNew(allocator);
         schema = ArrowSchema.allocateNew(allocator);
diff --git a/paimon-arrow/src/main/java/org/apache/paimon/arrow/vector/ArrowFormatWriter.java b/paimon-arrow/src/main/java/org/apache/paimon/arrow/vector/ArrowFormatWriter.java
index faa326557..dde2500d8 100644
--- a/paimon-arrow/src/main/java/org/apache/paimon/arrow/vector/ArrowFormatWriter.java
+++ b/paimon-arrow/src/main/java/org/apache/paimon/arrow/vector/ArrowFormatWriter.java
@@ -39,10 +39,10 @@ public class ArrowFormatWriter implements AutoCloseable {
     private final RootAllocator allocator;
     private int rowId;
 
-    public ArrowFormatWriter(RowType rowType, int writeBatchSize) {
+    public ArrowFormatWriter(RowType rowType, int writeBatchSize, boolean allowUpperCase) {
         allocator = new RootAllocator();
 
-        vectorSchemaRoot = ArrowUtils.createVectorSchemaRoot(rowType, allocator, false);
+        vectorSchemaRoot = ArrowUtils.createVectorSchemaRoot(rowType, allocator, allowUpperCase);
 
         fieldWriters = new ArrowFieldWriter[rowType.getFieldCount()];
 
diff --git a/paimon-arrow/src/test/java/org/apache/paimon/arrow/vector/ArrowFormatWriterTest.java b/paimon-arrow/src/test/java/org/apache/paimon/arrow/vector/ArrowFormatWriterTest.java
index 8642bebe5..5892616f1 100644
--- a/paimon-arrow/src/test/java/org/apache/paimon/arrow/vector/ArrowFormatWriterTest.java
+++ b/paimon-arrow/src/test/java/org/apache/paimon/arrow/vector/ArrowFormatWriterTest.java
@@ -84,7 +84,7 @@ public class ArrowFormatWriterTest {
 
     @Test
     public void testWrite() {
-        try (ArrowFormatWriter writer = new ArrowFormatWriter(PRIMITIVE_TYPE, 4096)) {
+        try (ArrowFormatWriter writer = new ArrowFormatWriter(PRIMITIVE_TYPE, 4096, false)) {
             List<InternalRow> list = new ArrayList<>();
             List<InternalRow.FieldGetter> fieldGetters = new ArrayList<>();
 
@@ -118,7 +118,7 @@ public class ArrowFormatWriterTest {
 
     @Test
     public void testReadWithSchemaMessUp() {
-        try (ArrowFormatWriter writer = new ArrowFormatWriter(PRIMITIVE_TYPE, 4096)) {
+        try (ArrowFormatWriter writer = new ArrowFormatWriter(PRIMITIVE_TYPE, 4096, false)) {
             List<InternalRow> list = new ArrayList<>();
             List<InternalRow.FieldGetter> fieldGetters = new ArrayList<>();
 
@@ -160,7 +160,7 @@ public class ArrowFormatWriterTest {
 
     @Test
     public void testArrowBundleRecords() {
-        try (ArrowFormatWriter writer = new ArrowFormatWriter(PRIMITIVE_TYPE, 4096)) {
+        try (ArrowFormatWriter writer = new ArrowFormatWriter(PRIMITIVE_TYPE, 4096, false)) {
             List<InternalRow> list = new ArrayList<>();
             List<InternalRow.FieldGetter> fieldGetters = new ArrayList<>();
 
@@ -192,7 +192,7 @@ public class ArrowFormatWriterTest {
 
     @Test
     public void testCWriter() {
-        try (ArrowFormatCWriter writer = new ArrowFormatCWriter(PRIMITIVE_TYPE, 4096)) {
+        try (ArrowFormatCWriter writer = new ArrowFormatCWriter(PRIMITIVE_TYPE, 4096, false)) {
             List<InternalRow> list = new ArrayList<>();
             List<InternalRow.FieldGetter> fieldGetters = new ArrayList<>();