Apache Hive : HPL/SQL - REPLACE Function

Last updated: August 12, 2026

Apache Hive : HPL/SQL - REPLACE Function

REPLACE function replaces all occurrences of the specified substring with another substring.

Syntax:

REPLACE(string, what, with)

Parameters:

ParameterTypeValueDescription
stringStringVariable or expressionOriginal string
whatStringVariable or expressionWhich substring to replace
withStringVariable or expressionReplacement

Return Type:

String.

Example:

replace('2016-03-03', '-', '');
--
20160303 

Compatibility: Oracle, Microsoft SQL Server, IBM DB2 and MySQL.