[
https://issues.apache.org/jira/browse/HIVE-25161?focusedWorklogId=604216&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-604216
]
ASF GitHub Bot logged work on HIVE-25161:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 31/May/21 16:14
Start Date: 31/May/21 16:14
Worklog Time Spent: 10m
Work Description: marton-bod commented on a change in pull request #2316:
URL: https://github.com/apache/hive/pull/2316#discussion_r642585589
##########
File path:
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerWithEngine.java
##########
@@ -535,19 +531,45 @@ public void testCTASFromHiveTable() {
TableProperties.DEFAULT_FILE_FORMAT, fileFormat));
List<Object[]> objects = shell.executeStatement("SELECT * FROM target
ORDER BY id");
- Assert.assertEquals(2, objects.size());
- Assert.assertArrayEquals(new Object[]{1L, "Mike", "HR"}, objects.get(0));
- Assert.assertArrayEquals(new Object[]{2L, "Linda", "Finance"},
objects.get(1));
+
HiveIcebergTestUtils.validateData(HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS,
+
HiveIcebergTestUtils.valueForRow(HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA,
objects), 0);
+ }
+
+ @Test
+ public void testCTASPartitionedFromHiveTable() throws TException,
InterruptedException {
+ Assume.assumeTrue(HiveIcebergSerDe.CTAS_EXCEPTION_MSG, testTableType ==
TestTables.TestTableType.HIVE_CATALOG);
+
+ shell.executeStatement("CREATE TABLE source (id bigint, name string)
PARTITIONED BY (dept string) STORED AS ORC");
+ shell.executeStatement(testTables.getInsertQuery(
+ HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS,
TableIdentifier.of("default", "source"), false));
+
+ shell.executeStatement(String.format(
+ "CREATE TABLE target PARTITIONED BY (dept, name) " +
+ "STORED BY '%s' TBLPROPERTIES ('%s'='%s') AS SELECT * FROM source",
Review comment:
Done
##########
File path:
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerWithEngine.java
##########
@@ -556,15 +578,18 @@ public void testCTASFailureRollback() throws IOException {
testTables.createTable(shell, "source",
HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA,
fileFormat, HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS);
- try {
- shell.executeStatement(String.format("CREATE TABLE target STORED BY '%s'
AS SELECT * FROM source",
- HiveIcebergStorageHandler.class.getName()));
- } catch (Exception e) {
- // expected error
- }
+ String[] partitioningSchemes = {"" /* unpartitioned */, "PARTITIONED BY
(dept)", "PARTITIONED BY (dept, name)"};
+ for (String partitioning : partitioningSchemes) {
+ try {
+ shell.executeStatement(String.format("CREATE TABLE target %s STORED BY
'%s' AS SELECT * FROM source",
Review comment:
Done
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 604216)
Time Spent: 7h 10m (was: 7h)
> Implement CTAS for partitioned Iceberg tables
> ---------------------------------------------
>
> Key: HIVE-25161
> URL: https://issues.apache.org/jira/browse/HIVE-25161
> Project: Hive
> Issue Type: New Feature
> Reporter: Marton Bod
> Assignee: Marton Bod
> Priority: Major
> Labels: pull-request-available
> Time Spent: 7h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)