diff --git a/velox/vector/arrow/Bridge.cpp b/velox/vector/arrow/Bridge.cpp index b6148a20f89f..6522ab9f18fc 100644 --- a/velox/vector/arrow/Bridge.cpp +++ b/velox/vector/arrow/Bridge.cpp @@ -248,6 +248,8 @@ const char* exportArrowFormatStr( return "u"; // utf-8 string case TypeKind::VARBINARY: return "z"; // binary + case TypeKind::UNKNOWN: + return "n"; // NullType case TypeKind::TIMESTAMP: return "ttn"; // time64 [nanoseconds] @@ -259,8 +261,6 @@ const char* exportArrowFormatStr( return "+m"; // map case TypeKind::ROW: return "+s"; // struct - case TypeKind::UNKNOWN: - return "n"; default: VELOX_NYI("Unable to map type '{}' to ArrowSchema.", type->kind()); diff --git a/velox/vector/arrow/tests/ArrowBridgeSchemaTest.cpp b/velox/vector/arrow/tests/ArrowBridgeSchemaTest.cpp index d39f378c526b..41d61340ec0e 100644 --- a/velox/vector/arrow/tests/ArrowBridgeSchemaTest.cpp +++ b/velox/vector/arrow/tests/ArrowBridgeSchemaTest.cpp @@ -238,25 +238,14 @@ TEST_F(ArrowBridgeSchemaExportTest, constant) { testConstant(DOUBLE(), "g"); testConstant(VARCHAR(), "u"); testConstant(DATE(), "tdD"); + testConstant(UNKNOWN(), "n"); testConstant(ARRAY(INTEGER()), "+l"); + testConstant(ARRAY(UNKNOWN()), "+l"); testConstant(MAP(BOOLEAN(), REAL()), "+m"); + testConstant(MAP(UNKNOWN(), REAL()), "+m"); testConstant(ROW({TIMESTAMP(), DOUBLE()}), "+s"); -} - -TEST_F(ArrowBridgeSchemaExportTest, unsupported) { - GTEST_SKIP() << "Skipping it, cause unknown type supported"; - // Try some combination of unsupported types to ensure there's no crash or - // memory leak in failure scenarios. - EXPECT_THROW(testScalarType(UNKNOWN(), ""), VeloxException); - - EXPECT_THROW(testScalarType(ARRAY(UNKNOWN()), ""), VeloxException); - EXPECT_THROW(testScalarType(MAP(UNKNOWN(), INTEGER()), ""), VeloxException); - EXPECT_THROW(testScalarType(MAP(BIGINT(), UNKNOWN()), ""), VeloxException); - - EXPECT_THROW(testScalarType(ROW({BIGINT(), UNKNOWN()}), ""), VeloxException); - EXPECT_THROW( - testScalarType(ROW({BIGINT(), REAL(), UNKNOWN()}), ""), VeloxException); + testConstant(ROW({UNKNOWN(), UNKNOWN()}), "+s"); } class ArrowBridgeSchemaImportTest : public ArrowBridgeSchemaExportTest {