@@ -66,15 +66,42 @@ static void read_orc_line(int64_t line, std::string block_dump) {
66
66
" col6" , " col7" , " col8" , " col9" };
67
67
ObjectPool object_pool;
68
68
DescriptorTblBuilder builder (&object_pool);
69
- builder.declare_tuple () << std::make_tuple (TYPE_BIGINT, " col1" )
70
- << std::make_tuple (TYPE_BOOLEAN, " col2" )
71
- << std::make_tuple (TYPE_STRING, " col3" )
72
- << std::make_tuple (TYPE_DATEV2, " col4" )
73
- << std::make_tuple (TYPE_DOUBLE, " col5" )
74
- << std::make_tuple (TYPE_FLOAT, " col6" )
75
- << std::make_tuple (TYPE_INT, " col7" )
76
- << std::make_tuple (TYPE_SMALLINT, " col8" )
77
- << std::make_tuple (TYPE_STRING, " col9" );
69
+ builder.declare_tuple () << std::make_tuple<vectorized::DataTypePtr, std::string>(
70
+ vectorized::DataTypeFactory::instance ().create_data_type (
71
+ TypeIndex::Int64, true ),
72
+ " col1" )
73
+ << std::make_tuple<vectorized::DataTypePtr, std::string>(
74
+ vectorized::DataTypeFactory::instance ().create_data_type (
75
+ TypeIndex::UInt8 , true ),
76
+ " col2" )
77
+ << std::make_tuple<vectorized::DataTypePtr, std::string>(
78
+ vectorized::DataTypeFactory::instance ().create_data_type (
79
+ TypeIndex::String, true ),
80
+ " col3" )
81
+ << std::make_tuple<vectorized::DataTypePtr, std::string>(
82
+ vectorized::DataTypeFactory::instance ().create_data_type (
83
+ TypeIndex::DateV2, true ),
84
+ " col4" )
85
+ << std::make_tuple<vectorized::DataTypePtr, std::string>(
86
+ vectorized::DataTypeFactory::instance ().create_data_type (
87
+ TypeIndex::Float64 , true ),
88
+ " col5" )
89
+ << std::make_tuple<vectorized::DataTypePtr, std::string>(
90
+ vectorized::DataTypeFactory::instance ().create_data_type (
91
+ TypeIndex::Float32 , true ),
92
+ " col6" )
93
+ << std::make_tuple<vectorized::DataTypePtr, std::string>(
94
+ vectorized::DataTypeFactory::instance ().create_data_type (
95
+ TypeIndex::Int32, true ),
96
+ " col7" )
97
+ << std::make_tuple<vectorized::DataTypePtr, std::string>(
98
+ vectorized::DataTypeFactory::instance ().create_data_type (
99
+ TypeIndex::Int16, true ),
100
+ " col8" )
101
+ << std::make_tuple<vectorized::DataTypePtr, std::string>(
102
+ vectorized::DataTypeFactory::instance ().create_data_type (
103
+ TypeIndex::String, true ),
104
+ " col9" );
78
105
DescriptorTbl* desc_tbl = builder.build ();
79
106
auto * tuple_desc = const_cast <TupleDescriptor*>(desc_tbl->get_tuple_descriptor (0 ));
80
107
RowDescriptor row_desc (tuple_desc, false );
@@ -113,8 +140,7 @@ static void read_orc_line(int64_t line, std::string block_dump) {
113
140
static_cast <void >(reader->set_fill_columns (partition_columns, missing_columns));
114
141
BlockUPtr block = Block::create_unique ();
115
142
for (const auto & slot_desc : tuple_desc->slots ()) {
116
- auto data_type =
117
- vectorized::DataTypeFactory::instance ().create_data_type (slot_desc->type (), true );
143
+ auto data_type = slot_desc->type ();
118
144
MutableColumnPtr data_column = data_type->create_column ();
119
145
block->insert (
120
146
ColumnWithTypeAndName (std::move (data_column), data_type, slot_desc->col_name ()));
0 commit comments