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 0950967  Add support for UInt64 (#70)
0950967 is described below

commit 095096766555f5ff05ecf5a3bb923325a26adf0b
Author: Sutou Kouhei <[email protected]>
AuthorDate: Tue Aug 22 15:43:57 2023 +0900

    Add support for UInt64 (#70)
    
    Closes GH-54
---
 src/afs.cc              | 12 ++++++++++++
 test/test-flight-sql.rb |  3 ++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/afs.cc b/src/afs.cc
index fc44d94..8e5e1f5 100644
--- a/src/afs.cc
+++ b/src/afs.cc
@@ -773,6 +773,12 @@ class ArrowPGTypeConverter : public arrow::TypeVisitor {
                return arrow::Status::OK();
        }
 
+       arrow::Status Visit(const arrow::UInt64Type& type)
+       {
+               oid_ = INT8OID;
+               return arrow::Status::OK();
+       }
+
    private:
        Oid oid_;
 };
@@ -826,6 +832,12 @@ class ArrowPGValueConverter : public arrow::ArrayVisitor {
                return arrow::Status::OK();
        }
 
+       arrow::Status Visit(const arrow::UInt64Array& array)
+       {
+               datum_ = UInt64GetDatum(array.Value(i_row_));
+               return arrow::Status::OK();
+       }
+
    private:
        int64_t i_row_;
        Datum& datum_;
diff --git a/test/test-flight-sql.rb b/test/test-flight-sql.rb
index dcc5735..caf68c2 100644
--- a/test/test-flight-sql.rb
+++ b/test/test-flight-sql.rb
@@ -87,7 +87,8 @@ 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]])
+  data("uint32", ["integer",  Arrow::UInt32Array, [1,  2, 3]])
+  data("uint64", ["bigint",   Arrow::UInt64Array, [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