mdayakar commented on code in PR #115: URL: https://github.com/apache/hive-site/pull/115#discussion_r3913878313
########## content/docs/latest/user/hive-hplsql/functions/max-part-string.md: ########## @@ -0,0 +1,82 @@ +--- +title: "Apache Hive : MAX_PART_STRING Function - HPL/SQL" +date: 2026-08-12 +--- + +# Apache Hive : MAX_PART_STRING Function - HPL/SQL + +MAX_PART_STRING function finds the maximum value (last in alphabetical order) for the specified partition column of type STRING (VARCHAR/CHAR). + +**Syntax**: + +``` +MAX_PART_STRING([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 + +**Return Value:** + +- The maximum string for the specified partition +- NULL if the table or partition do not exist, or the table is empty + +**Return Type:** + +STRING (VARCHAR/CHAR). + +**Example 1:** + +Table *db.orders* is partitioned by *country* and has the following partitions: + +| country=US | +| --- | +| country=UK | +| country=DE | + +Find the maximum value of the partition: + +``` +MAX_PART_STRING(db.orders); +``` + +Result: US + +**Example 2:** + +Table *db.sales* is partitioned by *country* and *local_date* and has the following partitions: + +| country=US/local_date=2014-12-02 | Review Comment: Fixed ########## content/docs/latest/user/hive-hplsql/functions/max-part-string.md: ########## @@ -0,0 +1,82 @@ +--- +title: "Apache Hive : MAX_PART_STRING Function - HPL/SQL" +date: 2026-08-12 +--- + +# Apache Hive : MAX_PART_STRING Function - HPL/SQL + +MAX_PART_STRING function finds the maximum value (last in alphabetical order) for the specified partition column of type STRING (VARCHAR/CHAR). + +**Syntax**: + +``` +MAX_PART_STRING([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 + +**Return Value:** + +- The maximum string for the specified partition +- NULL if the table or partition do not exist, or the table is empty + +**Return Type:** + +STRING (VARCHAR/CHAR). + +**Example 1:** + +Table *db.orders* is partitioned by *country* and has the following partitions: + +| country=US | 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]
