Skip to content

Commit

Permalink
fix(controller): use type string name other than category
Browse files Browse the repository at this point in the history
  • Loading branch information
jialeicui committed Sep 14, 2022
1 parent bb9f53d commit afd2ef4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void writeToStore(String tableName, InputStream jsonLine) {

private TableSchemaDesc toSchema(Map<String, ColumnType> tableSchemaMap) {
List<ColumnSchemaDesc> columnSchemaDescs = tableSchemaMap.entrySet().stream()
.map(entry -> new ColumnSchemaDesc(entry.getKey(), entry.getValue().getCategory())).collect(
.map(entry -> new ColumnSchemaDesc(entry.getKey(), entry.getValue().toString())).collect(
Collectors.toList());
return new TableSchemaDesc("id", columnSchemaDescs);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ public void testLegacySchema() {
List<ColumnSchemaDesc> columnSchemaList = tableSchemaDesc.getColumnSchemaList();
columnSchemaList.forEach(columnSchemaDesc -> {
if ("id".equals(columnSchemaDesc.getName())) {
Assertions.assertEquals(ColumnType.INT64.getCategory(), columnSchemaDesc.getType());
Assertions.assertEquals("INT64", columnSchemaDesc.getType());
}
if ("data_offset".equals(columnSchemaDesc.getName())) {
Assertions.assertEquals(ColumnType.INT64.getCategory(), columnSchemaDesc.getType());
Assertions.assertEquals("INT64", columnSchemaDesc.getType());
}
if ("data_size".equals(columnSchemaDesc.getName())) {
Assertions.assertEquals(ColumnType.INT64.getCategory(), columnSchemaDesc.getType());
Assertions.assertEquals("INT64", columnSchemaDesc.getType());
}
if ("data_format".equals(columnSchemaDesc.getName())) {
Assertions.assertEquals(ColumnType.STRING.getCategory(), columnSchemaDesc.getType());
Assertions.assertEquals("STRING", columnSchemaDesc.getType());
}
if ("object_store_type".equals(columnSchemaDesc.getName())) {
Assertions.assertEquals(ColumnType.STRING.getCategory(), columnSchemaDesc.getType());
Assertions.assertEquals("STRING", columnSchemaDesc.getType());
}
if ("score".equals(columnSchemaDesc.getName())) {
Assertions.assertEquals(ColumnType.FLOAT64.getCategory(), columnSchemaDesc.getType());
Assertions.assertEquals("FLOAT64", columnSchemaDesc.getType());
}
});
Assertions.assertEquals("table-x", request.getTableName());
Expand Down

0 comments on commit afd2ef4

Please sign in to comment.