[hive] branch dependabot/maven/itests/qtest-druid/org.apache.kafka-kafka-clients-2.6.3 created (now 34975bd91f9)
This is an automated email from the ASF dual-hosted git repository. github-bot pushed a change to branch dependabot/maven/itests/qtest-druid/org.apache.kafka-kafka-clients-2.6.3 in repository https://gitbox.apache.org/repos/asf/hive.git at 34975bd91f9 Bump org.apache.kafka:kafka-clients in /itests/qtest-druid No new revisions were added by this update.
[hive] branch dependabot/maven/itests/qtest-druid/org.apache.kafka-kafka_2.12-2.6.3 created (now e686ecdd326)
This is an automated email from the ASF dual-hosted git repository. github-bot pushed a change to branch dependabot/maven/itests/qtest-druid/org.apache.kafka-kafka_2.12-2.6.3 in repository https://gitbox.apache.org/repos/asf/hive.git at e686ecdd326 Bump org.apache.kafka:kafka_2.12 in /itests/qtest-druid No new revisions were added by this update.
[hive] branch master updated: HIVE-27659: Make partition order configurable if the metastore does not return all partitions (#4646)
This is an automated email from the ASF dual-hosted git repository. sunchao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hive.git The following commit(s) were added to refs/heads/master by this push: new 920f9e535db HIVE-27659: Make partition order configurable if the metastore does not return all partitions (#4646) 920f9e535db is described below commit 920f9e535db6270a401db274eef3267d70c1fd2f Author: Yuming Wang AuthorDate: Wed Sep 6 00:56:59 2023 +0800 HIVE-27659: Make partition order configurable if the metastore does not return all partitions (#4646) --- .../apache/hadoop/hive/ql/metadata/TestHive.java | 56 ++ .../hadoop/hive/metastore/conf/MetastoreConf.java | 5 ++ .../hadoop/hive/metastore/MetaStoreDirectSql.java | 2 +- 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java b/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java index df3ecf6f662..33171ebb0cb 100755 --- a/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java @@ -849,6 +849,62 @@ public class TestHive { } } + @Test + public void testGetPartitionsWithMaxLimit() throws Exception { +String dbName = Warehouse.DEFAULT_DATABASE_NAME; +String tableName = "table_for_get_partitions_with_max_limit"; + +try { + Map part_spec = new HashMap(); + + Table table = createPartitionedTable(dbName, tableName); + part_spec.clear(); + part_spec.put("ds", "2025-06-30"); + part_spec.put("hr", "11"); + hm.createPartition(table, part_spec); + + Thread.sleep(1); + part_spec.clear(); + part_spec.put("ds", "2023-04-15"); + part_spec.put("hr", "12"); + hm.createPartition(table, part_spec); + + Thread.sleep(1); + part_spec.clear(); + part_spec.put("ds", "2023-09-01"); + part_spec.put("hr", "10"); + hm.createPartition(table, part_spec); + + // Default + Assert.assertEquals( + ((List) hm.getPartitions(table, new HashMap(), (short) 1)).get(0).getTPartition().getValues(), + Arrays.asList("2023-04-15", "12")); + + // Sort by "PARTITIONS"."CREATE_TIME" desc + hm.setMetaConf(MetastoreConf.ConfVars.PARTITION_ORDER_EXPR.getVarname(), "\"PARTITIONS\".\"CREATE_TIME\" desc"); + Assert.assertEquals( + ((List) hm.getPartitions(table, new HashMap(), (short) 1)).get(0).getTPartition().getValues(), + Arrays.asList("2023-09-01", "10")); + + // Sort by "PART_NAME" desc + hm.setMetaConf(MetastoreConf.ConfVars.PARTITION_ORDER_EXPR.getVarname(), "\"PART_NAME\" desc"); + Assert.assertEquals( + ((List) hm.getPartitions(table, new HashMap(), (short) 1)).get(0).getTPartition().getValues(), + Arrays.asList("2025-06-30", "11")); + + // Test MetaStoreClient + Assert.assertEquals( + hm.getMSC().listPartitions(table.getDbName(), table.getTableName(), (short) 1).get(0).getValues(), + Arrays.asList("2025-06-30", "11")); +} catch (Exception e) { + fail("Unexpected exception: " + StringUtils.stringifyException(e)); +} finally { + hm.setMetaConf(MetastoreConf.ConfVars.PARTITION_ORDER_EXPR.getVarname(), + MetastoreConf.ConfVars.PARTITION_ORDER_EXPR.getDefaultVal().toString()); + cleanUpTableQuietly(dbName, tableName); +} + } + private void checkPartitionsConsistency(Table tbl) throws Exception { Set allParts = hm.getAllPartitionsOf(tbl); List allParts2 = hm.getPartitions(tbl); diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java index 323d953be12..6f597a1739d 100644 --- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java +++ b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java @@ -251,6 +251,7 @@ public class MetastoreConf { ConfVars.TRY_DIRECT_SQL_DDL, ConfVars.CLIENT_SOCKET_TIMEOUT, ConfVars.PARTITION_NAME_WHITELIST_PATTERN, + ConfVars.PARTITION_ORDER_EXPR, ConfVars.CAPABILITY_CHECK, ConfVars.DISALLOW_INCOMPATIBLE_COL_TYPE_CHANGES, ConfVars.EXPRESSION_PROXY_CLASS @@ -1266,6 +1267,10 @@ public class MetastoreConf { PARTITION_NAME_WHITELIST_PATTERN("metastore.partition.name.whitelist.pattern", "hive.metastore.partition.name.whitelist.pattern", "", "Partition names will be checked against this regex pattern and rejected if not matched."), +PARTITION_ORDER_EXPR("metastore.partition.order.expr", +"hive.metastore.partition.order.expr", "\"PART_NAME\" asc", +"The default partition order if the metastore does
[hive] branch master updated: HIVE-27642: Add missing dependency to StartMiniHS2Cluster with Postgres (Zoltan Ratkai reviewed by Stamatis Zampetakis)
This is an automated email from the ASF dual-hosted git repository. zabetak pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hive.git The following commit(s) were added to refs/heads/master by this push: new 44fdbee484b HIVE-27642: Add missing dependency to StartMiniHS2Cluster with Postgres (Zoltan Ratkai reviewed by Stamatis Zampetakis) 44fdbee484b is described below commit 44fdbee484bc717a1076f2c520f1adafc5190e9f Author: Zoltan Ratkai AuthorDate: Wed Aug 30 14:29:36 2023 +0200 HIVE-27642: Add missing dependency to StartMiniHS2Cluster with Postgres (Zoltan Ratkai reviewed by Stamatis Zampetakis) Closes #4644 --- itests/hive-unit/pom.xml | 5 + 1 file changed, 5 insertions(+) diff --git a/itests/hive-unit/pom.xml b/itests/hive-unit/pom.xml index af54522bb96..29ece216722 100644 --- a/itests/hive-unit/pom.xml +++ b/itests/hive-unit/pom.xml @@ -489,6 +489,11 @@ ${htmlunit.version} test + + org.postgresql + postgresql + test +
[hive] branch master updated (ff46f8812a8 -> bb7e6d67413)
This is an automated email from the ASF dual-hosted git repository. veghlaci05 pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/hive.git from ff46f8812a8 HIVE-27667: Fix get partitions with max_parts (#4662). (Yuming Wang, reviewed by Ayush Saxena) add bb7e6d67413 HIVE-27657: Change hive.fetch.task.conversion.threshold Default value (Mayank Kunwar, reviewed by Laszlo Vegh) No new revisions were added by this update. Summary of changes: common/src/java/org/apache/hadoop/hive/conf/HiveConf.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
[hive] branch master updated: HIVE-27667: Fix get partitions with max_parts (#4662). (Yuming Wang, reviewed by Ayush Saxena)
This is an automated email from the ASF dual-hosted git repository. ayushsaxena pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/hive.git The following commit(s) were added to refs/heads/master by this push: new ff46f8812a8 HIVE-27667: Fix get partitions with max_parts (#4662). (Yuming Wang, reviewed by Ayush Saxena) ff46f8812a8 is described below commit ff46f8812a80cf086c92af943dd4f9aff96290b0 Author: Yuming Wang AuthorDate: Tue Sep 5 15:32:01 2023 +0800 HIVE-27667: Fix get partitions with max_parts (#4662). (Yuming Wang, reviewed by Ayush Saxena) --- ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java | 3 +++ .../src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java| 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java b/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java index 897e2e20026..df3ecf6f662 100755 --- a/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/metadata/TestHive.java @@ -838,6 +838,9 @@ public class TestHive { partialSpec.put("hr", "14"); assertEquals(1, hm.getPartitions(tbl, partialSpec).size()); + // Test get partitions with max_parts + assertEquals(1, hm.getPartitions(tbl, new HashMap(), (short) 1).size()); + hm.dropTable(Warehouse.DEFAULT_DATABASE_NAME, tableName); } catch (Throwable e) { System.err.println(StringUtils.stringifyException(e)); diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java index a3b679c0abd..15916e78983 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java @@ -3959,7 +3959,7 @@ public class ObjectStore implements RawStore, Configurable { LOG.info( "Redirecting to directSQL enabled API: db: {} tbl: {} partVals: {}", db_name, tbl_name, Joiner.on(',').join(part_vals)); -return getPartitions(catName, db_name, tbl_name, -1); +return getPartitions(catName, db_name, tbl_name, max_parts); } LOG.debug("executing listPartitionNamesPsWithAuth"); Collection parts = getPartitionPsQueryResults(catName, db_name, tbl_name,