[ https://issues.apache.org/jira/browse/HIVE-25610?focusedWorklogId=664096&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-664096 ]
ASF GitHub Bot logged work on HIVE-25610: ----------------------------------------- Author: ASF GitHub Bot Created on: 12/Oct/21 14:31 Start Date: 12/Oct/21 14:31 Worklog Time Spent: 10m Work Description: marton-bod commented on a change in pull request #2715: URL: https://github.com/apache/hive/pull/2715#discussion_r727198385 ########## File path: iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java ########## @@ -721,6 +721,29 @@ public void testCreateTableWithoutColumnComments() { } } + @Test + public void testCreatePartitionedTableWithColumnComments() { + TableIdentifier identifier = TableIdentifier.of("default", "partitioned_with_comment_table"); + shell.executeStatement("CREATE EXTERNAL TABLE partitioned_with_comment_table (" + + "t_int INT COMMENT 'int column', " + + "t_string STRING COMMENT 'string column', " + + "t_string_2 STRING) " + + "PARTITIONED BY (t_string_3 STRING COMMENT 'partition column') " + + "STORED BY ICEBERG " + + testTables.locationForCreateTableSQL(identifier) + + testTables.propertiesForCreateTableSQL(ImmutableMap.of())); + org.apache.iceberg.Table icebergTable = testTables.loadTable(identifier); + + List<Object[]> rows = shell.executeStatement("DESCRIBE default.partitioned_with_comment_table"); + // The partition transform information is 3 extra lines, and 1 more line for the columns + Assert.assertEquals(icebergTable.schema().columns().size() + 4, rows.size()); + for (int i = 0; i < icebergTable.schema().columns().size(); i++) { + Types.NestedField field = icebergTable.schema().columns().get(i); + Assert.assertArrayEquals(new Object[] {field.name(), HiveSchemaUtil.convert(field.type()).getTypeName(), + field.doc() != null ? field.doc() : "from deserializer"}, rows.get(i)); Review comment: Do we know for sure that the Iceberg schema has the partition column comment pushed down? In case it's null on both Hive and Iceberg side, we'd still pass the test here -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 664096) Time Spent: 0.5h (was: 20m) > Handle partition field comments for Iceberg tables > -------------------------------------------------- > > Key: HIVE-25610 > URL: https://issues.apache.org/jira/browse/HIVE-25610 > Project: Hive > Issue Type: Bug > Reporter: Peter Vary > Assignee: Peter Vary > Priority: Major > Labels: pull-request-available > Time Spent: 0.5h > Remaining Estimate: 0h > > Currently partition comments are not sent to Iceberg during table creation. > Also {{AbstractSerDe}} provides methods to parse the column related fields > from the properties. We should reuse them whenever possible. -- This message was sent by Atlassian Jira (v8.3.4#803005)