vamsikarnika commented on code in PR #649:
URL: https://github.com/apache/incubator-xtable/pull/649#discussion_r1963620352
##########
xtable-hive-metastore/src/test/java/org/apache/xtable/hms/table/TestHudiHMSCatalogTableBuilder.java:
##########
@@ -80,64 +73,35 @@ void testGetCreateTableInput() {
setupCommonMocks();
setupMetaClientMocks();
- List<String> partitionFields =
- TEST_HUDI_INTERNAL_TABLE.getPartitioningFields().stream()
- .map(partitionField -> partitionField.getSourceField().getName())
- .collect(Collectors.toList());
-
Table table =
hudiHMSCatalogTableBuilder.getCreateTableRequest(
TEST_HUDI_INTERNAL_TABLE, TEST_CATALOG_TABLE_IDENTIFIER);
- ArgumentCaptor<List<String>> partitionsCaptor =
ArgumentCaptor.forClass(List.class);
verify(mockTablePropertiesExtractor)
- .getSparkTableProperties(
- partitionsCaptor.capture(),
- eq(""),
- any(Integer.class),
- eq(TEST_HUDI_INTERNAL_TABLE.getReadSchema()));
- assertEquals(partitionFields.size(), partitionsCaptor.getValue().size());
- assertEquals(partitionFields, partitionsCaptor.getValue());
+ .getTableProperties(eq(TEST_HUDI_INTERNAL_TABLE), any(Integer.class));
assertEquals(TEST_CATALOG_TABLE_IDENTIFIER.getTableName(),
table.getTableName());
assertEquals(TEST_CATALOG_TABLE_IDENTIFIER.getDatabaseName(),
table.getDbName());
assertEquals(3, table.getSd().getCols().size());
assertEquals(1, table.getPartitionKeys().size());
- assertNotNull(table.getParameters());
- assertFalse(table.getParameters().isEmpty());
- assertEquals(table.getParameters().get(HUDI_METADATA_CONFIG), "true");
Review Comment:
Have moved the logic to fetch table properties to
HudiCatalogTablePropertiesExtractor class which populate the fields we're
asserting here. Have added the tests in TestHudiCatalogTablePropertiesExractor
class to validate these.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]