pvary commented on a change in pull request #2765:
URL: https://github.com/apache/hive/pull/2765#discussion_r744560669
##########
File path:
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergSelects.java
##########
@@ -203,4 +204,29 @@ public void testScanTableCaseInsensitive() throws
IOException {
Assert.assertArrayEquals(new Object[] {0L, "Alice", "Brown"}, rows.get(0));
Assert.assertArrayEquals(new Object[] {1L, "Bob", "Green"}, rows.get(1));
}
+
+ /**
+ * Column pruning could become problematic when a single Map Task contains
multiple TableScan operators where
+ * different columns are pruned. This only occurs on MR, as Tez initializes
a single Map task for every TableScan
+ * operator.
+ */
+ @Test
+ public void testMultiColumnPruning() throws IOException {
+ shell.setHiveSessionValue("hive.cbo.enable", true);
+
+ Schema schema1 = new Schema(optional(1, "fk", Types.StringType.get()));
+ List<Record> records1 =
TestHelper.RecordsBuilder.newInstance(schema1).add("fk1").build();
+ testTables.createTable(shell, "table1", schema1, fileFormat, records1);
+
+ Schema schema2 = new Schema(optional(1, "fk", Types.StringType.get()),
optional(2, "val", Types.StringType.get()));
+ List<Record> records2 =
TestHelper.RecordsBuilder.newInstance(schema2).add("fk1", "val").build();
+ testTables.createTable(shell, "table2", schema2, fileFormat, records2);
+
+ // MR is needed for the reproduction
+ shell.setHiveSessionValue("hive.execution.engine", "mr");
Review comment:
With Hive 4.0.0 we do not support Iceberg. When I tried to run the tests
with MR, the inserts were not working. So I had to run the inserts with Tez,
and then the test query with MR.
OTOH this is a valid issue with MR, and older versions on Hive, where MR is
supported. (Maybe on newer version as well)
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]