This is an automated email from the ASF dual-hosted git repository.

stigahuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 52dcf609620b18778ae99efea91cd356987b0cc3
Author: Zoltan Borok-Nagy <[email protected]>
AuthorDate: Tue Jan 30 19:12:50 2024 +0100

    IMPALA-12742: (Addendum) add interop tests for DATE-partitioned Iceberg 
tables
    
    IMPALA-12742 fixed a bug related to DATE-partitioned Iceberg tables
    and it also added several tests. Though it did not add interop tests
    between Hive and Impala. This CR fills this gap.
    
    Change-Id: I38e6626d388be3b400e2276de4bf929f673beffb
    Reviewed-on: http://gerrit.cloudera.org:8080/20976
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 tests/query_test/test_iceberg.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tests/query_test/test_iceberg.py b/tests/query_test/test_iceberg.py
index 6baea6255..8679a3e91 100644
--- a/tests/query_test/test_iceberg.py
+++ b/tests/query_test/test_iceberg.py
@@ -1503,6 +1503,13 @@ class TestIcebergV2Table(IcebergTestSuite):
     hive_output = self.run_stmt_in_hive("SELECT count(*) FROM {}.{}".format(
         db, "ice_store_sales"))
     assert hive_output == "_c0\n2601498\n"
+    hive_output = self.run_stmt_in_hive("SELECT * FROM {}.{}".format(
+        db, "ice_alltypes_part_v2"))
+    # Cut off the long header line.
+    hive_output = hive_output.split("\n", 1)
+    hive_output = hive_output[1]
+    assert hive_output == \
+        "2,true,1,11,1.1,2.222,123.321,2022-02-22,impala\n"
 
   @SkipIfFS.hive
   def test_delete_hive_read(self, vector, unique_database):
@@ -1702,6 +1709,18 @@ class TestIcebergV2Table(IcebergTestSuite):
     assert hive_results == \
         "11,21,2111,531,75.20\n"
 
+    # HIVE-28048: Hive cannot run ORDER BY queries for Iceberg tables 
partitioned by
+    # decimal columns, so we order the results ourselves.
+    hive_results = self.run_stmt_in_hive("SELECT * FROM {}.{}".format(
+        db, "ice_alltypes_part_v2"))
+    # Throw away the header line and sort the results.
+    hive_results = hive_results.split("\n", 1)[1]
+    hive_results = hive_results.strip().split("\n")
+    hive_results.sort()
+    assert hive_results == [
+        "2,true,2,11,1.1,2.222,123.321,2022-04-22,impala",
+        "3,true,3,11,1.1,2.222,123.321,2022-05-22,impala"]
+
   def test_optimize(self, vector, unique_database):
     tbl_name = unique_database + ".optimize_iceberg"
     self.execute_query("""create table {0} (i int)

Reply via email to