|
12 | 12 | #include <velox/common/memory/Memory.h>
|
13 | 13 | #include <velox/type/Type.h>
|
14 | 14 | #include <velox/vector/TypeAliases.h>
|
15 |
| -#include <iostream> |
16 | 15 | #include <memory>
|
17 | 16 |
|
18 | 17 | #include "bindings.h"
|
|
23 | 22 | #include "velox/buffer/StringViewBufferHolder.h"
|
24 | 23 | #include "velox/common/base/Exceptions.h"
|
25 | 24 | #include "velox/functions/prestosql/registration/RegistrationFunctions.h"
|
26 |
| -#include "velox/type/Type.h" |
27 |
| -#include "velox/vector/TypeAliases.h" |
28 | 25 | #include "velox/vector/arrow/Abi.h"
|
29 | 26 | #include "velox/vector/arrow/Bridge.h"
|
| 27 | +#include <iostream> |
30 | 28 |
|
31 | 29 | #ifdef USE_TORCH
|
32 | 30 | #include <torch/csrc/utils/pybind.h> // @manual
|
@@ -136,12 +134,6 @@ py::class_<SimpleColumn<T>, BaseColumn> declareSimpleType(
|
136 | 134 | });
|
137 | 135 |
|
138 | 136 | using I = typename velox::TypeTraits<kind>::ImplType;
|
139 |
| - py::class_<I, velox::Type, std::shared_ptr<I>>( |
140 |
| - m, |
141 |
| - (std::string("VeloxType_") + velox::TypeTraits<kind>::name).c_str(), |
142 |
| - // TODO: Move the Koksi binding of Velox type to OSS |
143 |
| - py::module_local()) |
144 |
| - .def(py::init()); |
145 | 137 |
|
146 | 138 | // Empty Column
|
147 | 139 | m.def("Column", [](std::shared_ptr<I> type) {
|
@@ -681,23 +673,12 @@ void declareArrayType(py::module& m) {
|
681 | 673 | .def("withElements", &ArrayColumn::withElements);
|
682 | 674 |
|
683 | 675 | using I = typename velox::TypeTraits<velox::TypeKind::ARRAY>::ImplType;
|
684 |
| - py::class_<I, velox::Type, std::shared_ptr<I>>( |
685 |
| - m, |
686 |
| - "VeloxArrayType", |
687 |
| - // TODO: Move the Koksi binding of Velox type to OSS |
688 |
| - py::module_local()) |
689 |
| - .def(py::init<velox::TypePtr>()) |
690 |
| - .def("element_type", &velox::ArrayType::elementType); |
691 |
| - |
692 |
| - using J = typename velox::FixedSizeArrayType; |
693 |
| - py::class_<J, velox::Type, std::shared_ptr<J>>( |
694 |
| - m, "VeloxFixedArrayType", py::module_local()) |
695 |
| - .def(py::init<int, velox::TypePtr>()) |
696 |
| - .def("element_type", &velox::FixedSizeArrayType::elementType) |
697 |
| - .def("fixed_width", &velox::FixedSizeArrayType::fixedElementsWidth); |
| 676 | + |
| 677 | + using J = typename velox::FixedSizeArrayType; |
698 | 678 |
|
699 | 679 | // Empty Column
|
700 | 680 | m.def("Column", [](std::shared_ptr<I> type) {
|
| 681 | + std::cout<<"In array column..\n"; |
701 | 682 | return std::make_unique<ArrayColumn>(type);
|
702 | 683 | });
|
703 | 684 | m.def("Column", [](std::shared_ptr<J> type) {
|
@@ -737,14 +718,6 @@ void declareMapType(py::module& m) {
|
737 | 718 | .def("slice", &MapColumn::slice);
|
738 | 719 |
|
739 | 720 | using I = typename velox::TypeTraits<velox::TypeKind::MAP>::ImplType;
|
740 |
| - py::class_<I, velox::Type, std::shared_ptr<I>>( |
741 |
| - m, |
742 |
| - "VeloxMapType", |
743 |
| - // TODO: Move the Koksi binding of Velox type to OSS |
744 |
| - py::module_local()) |
745 |
| - .def(py::init<velox::TypePtr, velox::TypePtr>()) |
746 |
| - .def("key_type", &velox::MapType::keyType) |
747 |
| - .def("value_type", &velox::MapType::valueType); |
748 | 721 |
|
749 | 722 | m.def("Column", [](std::shared_ptr<I> type) {
|
750 | 723 | return std::make_unique<MapColumn>(type);
|
@@ -772,19 +745,6 @@ void declareRowType(py::module& m) {
|
772 | 745 | });
|
773 | 746 |
|
774 | 747 | using I = typename velox::TypeTraits<velox::TypeKind::ROW>::ImplType;
|
775 |
| - py::class_<I, velox::Type, std::shared_ptr<I>>( |
776 |
| - m, |
777 |
| - "VeloxRowType", |
778 |
| - // TODO: Move the Koksi binding of Velox type to OSS |
779 |
| - py::module_local()) |
780 |
| - .def(py::init< |
781 |
| - std::vector<std::string>&&, |
782 |
| - std::vector<std::shared_ptr<const velox::Type>>&&>()) |
783 |
| - .def("size", &I::size) |
784 |
| - .def("get_child_idx", &I::getChildIdx) |
785 |
| - .def("contains_child", &I::containsChild) |
786 |
| - .def("name_of", &I::nameOf) |
787 |
| - .def("child_at", &I::childAt); |
788 | 748 | m.def("Column", [](std::shared_ptr<I> type) {
|
789 | 749 | return std::make_unique<RowColumn>(type);
|
790 | 750 | });
|
@@ -833,32 +793,6 @@ PYBIND11_MODULE(_torcharrow, m) {
|
833 | 793 | .def_property_readonly("length", &BaseColumn::getLength)
|
834 | 794 | .def("__len__", &BaseColumn::getLength);
|
835 | 795 |
|
836 |
| - py::enum_<velox::TypeKind>( |
837 |
| - m, |
838 |
| - "TypeKind", // TODO: Move the Koksi binding of Velox type to OSS |
839 |
| - py::module_local()) |
840 |
| - .value("BOOLEAN", velox::TypeKind::BOOLEAN) |
841 |
| - .value("TINYINT", velox::TypeKind::TINYINT) |
842 |
| - .value("SMALLINT", velox::TypeKind::SMALLINT) |
843 |
| - .value("INTEGER", velox::TypeKind::INTEGER) |
844 |
| - .value("BIGINT", velox::TypeKind::BIGINT) |
845 |
| - .value("REAL", velox::TypeKind::REAL) |
846 |
| - .value("DOUBLE", velox::TypeKind::DOUBLE) |
847 |
| - .value("VARCHAR", velox::TypeKind::VARCHAR) |
848 |
| - .value("VARBINARY", velox::TypeKind::VARBINARY) |
849 |
| - .value("TIMESTAMP", velox::TypeKind::TIMESTAMP) |
850 |
| - .value("ARRAY", velox::TypeKind::ARRAY) |
851 |
| - .value("MAP", velox::TypeKind::MAP) |
852 |
| - .value("ROW", velox::TypeKind::ROW) |
853 |
| - .export_values(); |
854 |
| - |
855 |
| - py::class_<velox::Type, std::shared_ptr<velox::Type>>( |
856 |
| - m, |
857 |
| - "VeloxType", |
858 |
| - // TODO: Move the Koksi binding of Velox type to OSS |
859 |
| - py::module_local()) |
860 |
| - .def("kind", &velox::Type::kind) |
861 |
| - .def("kind_name", &velox::Type::kindName); |
862 | 796 |
|
863 | 797 | declareIntegralType<velox::TypeKind::BIGINT>(m);
|
864 | 798 | declareIntegralType<velox::TypeKind::INTEGER>(m);
|
|
0 commit comments