Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion velox/docs/functions/presto/geospatial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ Accessors

Returns the minimum convex geometry that encloses all input geometries.

.. function:: ST_CoordDim(geometry: Geometry) -> output: integer
.. function:: ST_CoordDim(geometry: Geometry) -> output: tinyint

Return the coordinate dimension of the geometry.

Expand Down
4 changes: 2 additions & 2 deletions velox/functions/prestosql/GeometryFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1161,12 +1161,12 @@ class StCoordDimFunction : public facebook::velox::exec::VectorFunction {
// Create a constant vector of value 2, with size equal to the number of
// rows
result = facebook::velox::BaseVector::createConstant(
outputType, 2, rows.size(), context.pool());
outputType, static_cast<int8_t>(2), rows.size(), context.pool());
}
static std::vector<std::shared_ptr<facebook::velox::exec::FunctionSignature>>
signatures() {
return {facebook::velox::exec::FunctionSignatureBuilder()
.returnType("integer")
.returnType("tinyint")
.argumentType("geometry")
.build()};
}
Expand Down
6 changes: 3 additions & 3 deletions velox/functions/prestosql/tests/GeometryFunctionsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2169,9 +2169,9 @@ TEST_F(GeometryFunctionsTest, testStConvexHull) {

TEST_F(GeometryFunctionsTest, testStCoordDim) {
const auto testStCoordDimFunc = [&](const std::optional<std::string>& wkt,
const std::optional<int32_t>& expected) {
std::optional<int32_t> result =
evaluateOnce<int32_t>("ST_CoordDim(ST_GeometryFromText(c0))", wkt);
const std::optional<int8_t>& expected) {
std::optional<int8_t> result =
evaluateOnce<int8_t>("ST_CoordDim(ST_GeometryFromText(c0))", wkt);

if (expected.has_value()) {
ASSERT_TRUE(result.has_value());
Expand Down
Loading