-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve error msg of HiveTypeSerializer (#11118)
Summary: so it's clear why it's failing Pull Request resolved: #11118 Reviewed By: xiaoxmeng Differential Revision: D63554207 Pulled By: kunigami fbshipit-source-id: 47716785b5128721540d66dee639d3c1d655b7b8
- Loading branch information
1 parent
6f40034
commit fef4915
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include <memory> | ||
#include <stdexcept> | ||
|
||
#include "gtest/gtest-message.h" | ||
#include "gtest/gtest-test-part.h" | ||
#include "gtest/gtest.h" | ||
#include "velox/common/base/tests/GTestUtils.h" | ||
#include "velox/type/fbhive/HiveTypeSerializer.h" | ||
|
||
using facebook::velox::TypeKind; | ||
|
||
namespace facebook::velox::type::fbhive { | ||
|
||
TEST(HiveTypeSerializer, primitive) { | ||
std::shared_ptr<const velox::Type> type = velox::BIGINT(); | ||
auto result = HiveTypeSerializer::serialize(type); | ||
EXPECT_EQ(result, "bigint"); | ||
} | ||
|
||
TEST(HiveTypeSerializer, opaque) { | ||
std::shared_ptr<const velox::Type> type = velox::OPAQUE<bool>(); | ||
VELOX_ASSERT_THROW( | ||
HiveTypeSerializer::serialize(type), "unsupported type: OPAQUE<bool>"); | ||
} | ||
} // namespace facebook::velox::type::fbhive |