Skip to content

Commit

Permalink
Merge pull request #27699: Don't make StorageAPI tablerow names case-…
Browse files Browse the repository at this point in the history
…sensitive
  • Loading branch information
reuvenlax authored Jul 26, 2023
2 parents d241eae + 2e95849 commit 1f4defa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ private SchemaInformation(
new SchemaInformation(
field, Iterables.concat(this.parentSchemas, ImmutableList.of(this)));
subFields.add(schemaInformation);
subFieldsByName.put(field.getName(), schemaInformation);
subFieldsByName.put(field.getName().toLowerCase(), schemaInformation);
}
}

Expand All @@ -365,9 +365,9 @@ public TableFieldSchema.Type getType() {
}

public SchemaInformation getSchemaForField(String name) {
SchemaInformation schemaInformation = subFieldsByName.get(name);
SchemaInformation schemaInformation = subFieldsByName.get(name.toLowerCase());
if (schemaInformation == null) {
throw new RuntimeException("Schema field not found: " + name);
throw new RuntimeException("Schema field not found: " + name.toLowerCase());
}
return schemaInformation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,7 @@ public void testCreateNever() throws Exception {
new SimpleFunction<Long, TableRow>() {
@Override
public TableRow apply(Long input) {
return new TableRow().set("name", "name " + input).set("number", input);
return new TableRow().set("NaMe", "name " + input).set("numBEr", input);
}
}))
.setCoder(TableRowJsonCoder.of());
Expand Down

0 comments on commit 1f4defa

Please sign in to comment.