mdayakar commented on code in PR #115: URL: https://github.com/apache/hive-site/pull/115#discussion_r3913880563
########## content/docs/latest/user/hive-hplsql/functions/max-part-int.md: ########## @@ -0,0 +1,85 @@ +--- +title: "Apache Hive : MAX_PART_INT Function - HPL/SQL" +date: 2026-08-12 +--- + +# Apache Hive : MAX_PART_INT Function - HPL/SQL + +MAX_PART_INT function finds the maximum value for the specified partition column of type INT. + +**Syntax**: + +``` +MAX_PART_INT([db_name.]table_name [, column_name [, part_col=filter, ...]]); +``` + +**Parameters:** + +| **Parameter** | **Type** | **Value** | **Description** | +| --- | --- | --- | --- | +| [dbname.]table_name | VARCHAR | Identifier, variable or expression | Table name | +| column_name | VARCHAR | Identifier, variable or expression | Partition column name | +| part_col=filter | | | Partition filter | + +**Notes**: + +- If column name is not specified, the first partition column is used +- Partition filter applied before finding the maximum value +- If the partition contains non-integer values they are ignored + +**Return Value:** + +- The maximum INT value for the specified partition +- NULL if the table or partition do not exist, or the table is empty + +**Return Type:** + +INT. + +**Example 1:** + +Table *db.orders* is partitioned by *country*, *local_dt* and *hour* and has the following partitions: + +| country=US/local_dt=2014-12-05/hour=1 | +| --- | +| country=US/local_dt=2014-12-05/hour=2 | +| country=US/local_dt=2014-12-05/hour=3 | +| country=US/local_dt=2014-12-05/hour=UNKNOWN | + +Find the maximum value of the partition *hour*: + +``` +MAX_PART_INT(db.orders, hour); +``` + +Result: 3 + +**Example 2:** + +Table *db.sales* is partitioned by *country*, *local_date* and *hour* has the following partitions: + +| country=US/local_dt=2014-12-06/hour=1 | Review Comment: Fixed ########## content/docs/latest/user/hive-hplsql/functions/max-part-int.md: ########## @@ -0,0 +1,85 @@ +--- +title: "Apache Hive : MAX_PART_INT Function - HPL/SQL" +date: 2026-08-12 +--- + +# Apache Hive : MAX_PART_INT Function - HPL/SQL + +MAX_PART_INT function finds the maximum value for the specified partition column of type INT. + +**Syntax**: + +``` +MAX_PART_INT([db_name.]table_name [, column_name [, part_col=filter, ...]]); +``` + +**Parameters:** + +| **Parameter** | **Type** | **Value** | **Description** | +| --- | --- | --- | --- | +| [dbname.]table_name | VARCHAR | Identifier, variable or expression | Table name | +| column_name | VARCHAR | Identifier, variable or expression | Partition column name | +| part_col=filter | | | Partition filter | + +**Notes**: + +- If column name is not specified, the first partition column is used +- Partition filter applied before finding the maximum value +- If the partition contains non-integer values they are ignored + +**Return Value:** + +- The maximum INT value for the specified partition +- NULL if the table or partition do not exist, or the table is empty + +**Return Type:** + +INT. + +**Example 1:** + +Table *db.orders* is partitioned by *country*, *local_dt* and *hour* and has the following partitions: + +| country=US/local_dt=2014-12-05/hour=1 | Review Comment: Fixed -- 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]
