입력 배열이 비어 있는지 확인합니다.
empty([x])
배열에 요소가 포함되어 있지 않은 경우 배열은 비어 있는 것으로 간주됩니다.
Note
Can be optimized by enabling the optimize_functions_to_subcolumns setting. With optimize_functions_to_subcolumns = 1 the function reads only size0 subcolumn instead of reading and processing the whole array column. The query SELECT empty(arr) FROM TABLE; transforms to SELECT arr.size0 = 0 FROM TABLE;.
이 기능은 문자열 또는 UUID에서도 작동합니다.
[x] - 입력 배열Query:
SELECT empty([]);
Result:
| empty(array()) |
|---|
| 1 |
입력 배열이 비어 있지 않은지 확인합니다.
notEmpty([x])
배열에 하나 이상의 요소가 포함된 경우 배열은 비어 있지 않은 것으로 간주됩니다.
Note
Can be optimized by enabling the optimize_functions_to_subcolumns setting. With optimize_functions_to_subcolumns = 1 the function reads only size0 subcolumn instead of reading and processing the whole array column. The query SELECT notEmpty(arr) FROM table transforms to SELECT arr.size0 != 0 FROM TABLE.
이 기능은 문자열 또는 UUID에서도 작동합니다.
[x] - 입력 배열Query:
SELECT notEmpty([1,2]);
Result:
| notEmpty([1, 2]) |
|---|
| 1 |
배열의 항목 수를 반환합니다. 결과 유형은 UInt64입니다. 이 함수는 문자열에서도 작동합니다.
optimize_functions_to_subcolumns 설정을 활성화하여 최적화할 수 있습니다. optimize_functions_to_subcolumns = 1을 사용하면 함수는 전체 배열 열을 읽고 처리하는 대신 크기 0 하위 열만 읽습니다. SELECT length(ar) FROM TABLE 쿼리는 SELECT arr.size0 FROM TABLE로 변환됩니다.
별칭: OCTET_LENGHT
빈 UInt8 배열을 반환합니다.
emptyArrayUInt8()
없음.
빈 배열.
Query:
SELECT emptyArrayUInt8();
Result:
[]
빈 UInt16 배열을 반환합니다.
emptyArrayUInt16()
없음.
빈 배열.
Query:
SELECT emptyArrayUInt16();
Result:
[]
빈 UInt32 배열을 반환합니다.
emptyArrayUInt32()
없음.
빈 배열.
Query:
SELECT emptyArrayUInt32();
Result:
[]
빈 UInt64 배열을 반환합니다.
emptyArrayUInt64()
없음.
빈 배열.
Query:
SELECT emptyArrayUInt64();
Result:
[]