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

kou pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/arrow-flight-sql-postgresql.git


The following commit(s) were added to refs/heads/main by this push:
     new cd44d23  Add support for UInt32 (#69)
cd44d23 is described below

commit cd44d235fe9169f8c6b1325ae3eb60dde375d62b
Author: Sutou Kouhei <[email protected]>
AuthorDate: Tue Aug 22 15:35:38 2023 +0900

    Add support for UInt32 (#69)
    
    Closes GH-53
---
 src/afs.cc              | 12 ++++++++++++
 test/test-flight-sql.rb |  1 +
 2 files changed, 13 insertions(+)

diff --git a/src/afs.cc b/src/afs.cc
index a31505a..fc44d94 100644
--- a/src/afs.cc
+++ b/src/afs.cc
@@ -761,6 +761,12 @@ class ArrowPGTypeConverter : public arrow::TypeVisitor {
                return arrow::Status::OK();
        }
 
+       arrow::Status Visit(const arrow::UInt32Type& type)
+       {
+               oid_ = INT4OID;
+               return arrow::Status::OK();
+       }
+
        arrow::Status Visit(const arrow::Int64Type& type)
        {
                oid_ = INT8OID;
@@ -808,6 +814,12 @@ class ArrowPGValueConverter : public arrow::ArrayVisitor {
                return arrow::Status::OK();
        }
 
+       arrow::Status Visit(const arrow::UInt32Array& array)
+       {
+               datum_ = UInt32GetDatum(array.Value(i_row_));
+               return arrow::Status::OK();
+       }
+
        arrow::Status Visit(const arrow::Int64Array& array)
        {
                datum_ = Int64GetDatum(array.Value(i_row_));
diff --git a/test/test-flight-sql.rb b/test/test-flight-sql.rb
index 6431f8e..dcc5735 100644
--- a/test/test-flight-sql.rb
+++ b/test/test-flight-sql.rb
@@ -87,6 +87,7 @@ SELECT * FROM data
   data("int64",  ["bigint",   Arrow::Int64Array,  [1, -2, 3]])
   data("uint8",  ["smallint", Arrow::UInt8Array,  [1,  2, 3]])
   data("uint16", ["smallint", Arrow::UInt16Array, [1,  2, 3]])
+  data("uint32", ["smallint", Arrow::UInt32Array, [1,  2, 3]])
   def test_insert_type
     unless flight_sql_client.respond_to?(:prepare)
       omit("red-arrow-flight-sql 14.0.0 or later is required")

Reply via email to