You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2023/06/27 22:13:02 UTC

[arrow-adbc] branch main updated: feat(c/driver/postgresql): Better type error messages (#860)

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

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 9488aec3 feat(c/driver/postgresql): Better type error messages (#860)
9488aec3 is described below

commit 9488aec3a45cdc38e40ef5ce70b34f965ad38387
Author: William Ayd <wi...@icloud.com>
AuthorDate: Tue Jun 27 15:12:56 2023 -0700

    feat(c/driver/postgresql): Better type error messages (#860)
---
 c/driver/postgresql/statement.cc | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/c/driver/postgresql/statement.cc b/c/driver/postgresql/statement.cc
index 30920467..bacf99ac 100644
--- a/c/driver/postgresql/statement.cc
+++ b/c/driver/postgresql/statement.cc
@@ -330,11 +330,10 @@ struct BindStream {
               break;
             }
             default:
-              // TODO: data type to string
-              SetError(error, "%s%" PRId64 "%s%s%s%ud", "[libpq] Field #", col + 1, " ('",
+              SetError(error, "%s%" PRId64 "%s%s%s%s", "[libpq] Field #", col + 1, " ('",
                        bind_schema->children[col]->name,
                        "') has unsupported type for ingestion ",
-                       bind_schema_fields[col].type);
+                       ArrowTypeString(bind_schema_fields[col].type));
               return ADBC_STATUS_NOT_IMPLEMENTED;
           }
         }
@@ -598,10 +597,10 @@ AdbcStatusCode PostgresStatement::CreateBulkTable(
         create += " BYTEA";
         break;
       default:
-        // TODO: data type to string
-        SetError(error, "%s%" PRIu64 "%s%s%s%ud", "[libpq] Field #",
+        SetError(error, "%s%" PRIu64 "%s%s%s%s", "[libpq] Field #",
                  static_cast<uint64_t>(i + 1), " ('", source_schema.children[i]->name,
-                 "') has unsupported type for ingestion ", source_schema_fields[i].type);
+                 "') has unsupported type for ingestion ",
+                 ArrowTypeString(source_schema_fields[i].type));
         return ADBC_STATUS_NOT_IMPLEMENTED;
     }
   }