From 374160b6a41f22f16821572ff5b40480d1897af7 Mon Sep 17 00:00:00 2001 From: Stephen Judkins Date: Tue, 19 Oct 2021 15:04:51 -0700 Subject: [PATCH] fix: BQ/proto schema names should be compared lowercase --- .../google/cloud/bigquery/storage/v1/JsonToProtoMessage.java | 2 +- .../cloud/bigquery/storage/v1beta2/JsonToProtoMessage.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessage.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessage.java index d891fbf972..91a432c258 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessage.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessage.java @@ -124,7 +124,7 @@ private static DynamicMessage convertJsonToProtoMessageImpl( if (tableSchema != null) { // protoSchema is generated from tableSchema so their field ordering should match. fieldSchema = tableSchema.get(field.getIndex()); - if (!fieldSchema.getName().equals(field.getName())) { + if (!fieldSchema.getName().toLowerCase().equals(field.getName())) { throw new ValidationException( "Field at index " + field.getIndex() diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/JsonToProtoMessage.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/JsonToProtoMessage.java index 7a66927486..7d07130233 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/JsonToProtoMessage.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/JsonToProtoMessage.java @@ -123,7 +123,7 @@ private static DynamicMessage convertJsonToProtoMessageImpl( if (tableSchema != null) { // protoSchema is generated from tableSchema so their field ordering should match. fieldSchema = tableSchema.get(field.getIndex()); - if (!fieldSchema.getName().equals(field.getName())) { + if (!fieldSchema.getName().toLowerCase().equals(field.getName())) { throw new ValidationException( "Field at index " + field.getIndex()