From 0bb33456d61b4228dbbd8dde3030d704bb30f9a9 Mon Sep 17 00:00:00 2001 From: PHILO-HE Date: Mon, 17 Jun 2024 17:30:28 +0800 Subject: [PATCH] Fix comment --- velox/docs/functions/spark/array.rst | 2 +- velox/docs/functions/spark/map.rst | 2 +- velox/functions/sparksql/Size.cpp | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/velox/docs/functions/spark/array.rst b/velox/docs/functions/spark/array.rst index 326c6352b1ad..d19ab03eb826 100644 --- a/velox/docs/functions/spark/array.rst +++ b/velox/docs/functions/spark/array.rst @@ -161,7 +161,7 @@ Array Functions SELECT shuffle(array(0, 0, 0), 0); -- [0, 0, 0] SELECT shuffle(array(1, NULL, 1, NULL, 2), 0); -- [2, 1, NULL, NULL, 1] -.. spark:function:: size(array(E), legacySizeOfNull) -> int +.. spark:function:: size(array(E), legacySizeOfNull) -> integer Returns the size of the array. Returns null for null input if `legacySizeOfNull` is set to false. Otherwise, returns -1 for null input. diff --git a/velox/docs/functions/spark/map.rst b/velox/docs/functions/spark/map.rst index 39b2d497d229..f939b72fa4f5 100644 --- a/velox/docs/functions/spark/map.rst +++ b/velox/docs/functions/spark/map.rst @@ -41,7 +41,7 @@ Map Functions Returns all the values in the map ``x``. -.. spark:function:: size(map(K,V), legacySizeOfNull) -> int +.. spark:function:: size(map(K,V), legacySizeOfNull) -> integer :noindex: Returns the size of the input map. Returns null for null input if ``legacySizeOfNull`` diff --git a/velox/functions/sparksql/Size.cpp b/velox/functions/sparksql/Size.cpp index 19f64940a1e3..a474797d8140 100644 --- a/velox/functions/sparksql/Size.cpp +++ b/velox/functions/sparksql/Size.cpp @@ -62,9 +62,8 @@ struct Size { if (legacySizeOfNull_) { out = -1; return true; - } else { - return false; } + return false; } out = input->size(); return true;