All Products
Search
Document Center

MaxCompute:SPACE

Last Updated:Jul 28, 2023

Generates a space string with a length of n.

Syntax

string space(bigint <n>)

Parameters

n: required. A value of the BIGINT type. The returned string cannot exceed 2 MB in length.

Return value

A value of the STRING type is returned. The return value varies based on the following rules:

  • If n is left empty, an error is returned.

  • If the value of n is null, null is returned.

Examples

-- The return value is 10. 
select length(space(10));

Related functions

SPACE is a string function. For more information about functions related to string searches and conversion, see String functions.