Skip to content

Commit

Permalink
Delete unused UnsafeRowStaticParser (#4961)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #4961

Reviewed By: kevinwilfong

Differential Revision: D45914154

Pulled By: mbasmanova

fbshipit-source-id: d27bfdf2f1f5aa85fc235646af47f933ed86c7d0
  • Loading branch information
mbasmanova authored and facebook-github-bot committed May 16, 2023
1 parent 1de7869 commit cc50b17
Showing 1 changed file with 0 additions and 49 deletions.
49 changes: 0 additions & 49 deletions velox/row/UnsafeRowParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,55 +65,6 @@ struct UnsafeRowStaticUtilities {
}
};

/**
* A templated UnsafeRow parser.
* @tparam SqlTypes The row schema.
*/
template <typename... SqlTypes>
struct UnsafeRowStaticParser {
template <size_t idx>
using type_at =
typename std::tuple_element<idx, std::tuple<SqlTypes...>>::type;

/**
* The const UnsafeRow for parsing.
*/
const UnsafeRow row;

UnsafeRowStaticParser<SqlTypes...>(std::string_view data)
: row(UnsafeRow(
const_cast<char*>(data.data()),
std::tuple_size<std::tuple<SqlTypes...>>::value)) {}

/**
*
* @tparam idx
* @return
*/
template <size_t idx>
const std::string_view dataAt() const {
using CurrentType = type_at<idx>;

constexpr bool isFixedWidth =
UnsafeRowStaticUtilities::isFixedWidth<CurrentType>();
using NativeType =
typename TypeTraits<UnsafeRowStaticUtilities::simpleSqlTypeToTypeKind<
CurrentType>()>::NativeType;
if constexpr (!std::is_same_v<NativeType, void>) {
return row.readDataAt(idx, isFixedWidth, sizeof(NativeType));
}
return row.readDataAt(idx, isFixedWidth);
}

/**
* @param idx
* @return whether the element is null at the given index
*/
bool isNullAt(size_t idx) const {
return row.isNullAt(idx);
}
};

/**
* A dynamic UnsafeRowParser that uses TypePtr.
*/
Expand Down

0 comments on commit cc50b17

Please sign in to comment.