Skip to content

Commit 07767ab

Browse files
committed
Refine error messages of unsupported column type
1 parent 8be33ee commit 07767ab

10 files changed

Lines changed: 60 additions & 34 deletions

src/gpu_expression_executor.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ GPUExpressionExecutor::HandleBinaryConstantExpression(shared_ptr<GPUColumn> colu
4545
double constant = expr.value.GetValue<double>();
4646
return ResolveTypeBinaryConstantExpression<double>(column, constant, gpuBufferManager, function_name);
4747
} default:
48-
throw NotImplementedException("Unsupported column type");
48+
throw NotImplementedException("Unsupported column type in `HandleBinaryConstantExpression`: %d",
49+
static_cast<int>(column->data_wrapper.type));
4950
}
5051
}
5152

@@ -83,7 +84,8 @@ GPUExpressionExecutor::HandleBinaryExpression(shared_ptr<GPUColumn> column1, sha
8384
case ColumnType::FLOAT64:
8485
return ResolveTypeBinaryExpression<double>(column1, column2, gpuBufferManager, function_name);
8586
default:
86-
throw NotImplementedException("Unsupported column type");
87+
throw NotImplementedException("Unsupported column type in `HandleBinaryExpression`: %d",
88+
static_cast<int>(column1->data_wrapper.type));
8789
}
8890
}
8991

@@ -145,7 +147,8 @@ GPUExpressionExecutor::HandleComparisonConstantExpression(shared_ptr<GPUColumn>
145147
ResolveTypeComparisonConstantExpression<uint8_t>(column, expr1, expr2, count, row_ids, expression_type);
146148
break;
147149
default:
148-
throw NotImplementedException("Unsupported column type");
150+
throw NotImplementedException("Unsupported column type in `HandleComparisonConstantExpression`: %d",
151+
static_cast<int>(column->data_wrapper.type));
149152
}
150153
}
151154

@@ -195,7 +198,8 @@ GPUExpressionExecutor::HandleComparisonExpression(shared_ptr<GPUColumn> column1,
195198
ResolveTypeComparisonExpression<double>(column1, column2, count, row_ids, expression_type);
196199
break;
197200
default:
198-
throw NotImplementedException("Unsupported column type");
201+
throw NotImplementedException("Unsupported column type in `HandleComparisonExpression`: %d",
202+
static_cast<int>(column1->data_wrapper.type));
199203
}
200204
}
201205

@@ -218,7 +222,8 @@ GPUExpressionExecutor::HandleRoundExpression(shared_ptr<GPUColumn> column, int d
218222
shared_ptr<GPUColumn> result = make_shared_ptr<GPUColumn>(size, column->data_wrapper.type, reinterpret_cast<uint8_t*>(c));
219223
return result;
220224
} default:
221-
throw NotImplementedException("Unsupported column type");
225+
throw NotImplementedException("Unsupported column type in `HandleRoundExpression`: %d",
226+
static_cast<int>(column->data_wrapper.type));
222227
}
223228
}
224229

src/include/gpu_columns.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ inline ColumnType convertLogicalTypeToColumnType(LogicalType type) {
4646
column_type = ColumnType::VARCHAR;
4747
break;
4848
default:
49-
throw InvalidInputException("Unsupported column type");
49+
throw InvalidInputException("Unsupported column type in `convertLogicalTypeToColumnType`: %d",
50+
static_cast<int>(type.id()));
5051
break;
5152
}
5253
return column_type;

src/operator/gpu_materialize.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ HandleMaterializeExpression(shared_ptr<GPUColumn> column, BoundReferenceExpressi
6969
case ColumnType::VARCHAR:
7070
return ResolveTypeMaterializeString(column, bound_ref, gpuBufferManager);
7171
default:
72-
throw NotImplementedException("Unsupported column type");
72+
throw NotImplementedException("Unsupported column type in `HandleMaterializeExpression`: {}",
73+
static_cast<int>(column->data_wrapper.type));
7374
}
7475
}
7576

src/operator/gpu_physical_grouped_aggregate.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ CombineColumns(shared_ptr<GPUColumn> column1, shared_ptr<GPUColumn> column2, GPU
5353
return ResolveTypeCombineStrings(column1, column2, gpuBufferManager);
5454
break;
5555
default:
56-
throw NotImplementedException("Unsupported column type");
56+
throw NotImplementedException("Unsupported column type in `CombineColumns: %d",
57+
static_cast<int>(column1->data_wrapper.type));
5758
}
5859
}
5960

@@ -259,7 +260,8 @@ HandleGroupByAggregateExpression(vector<shared_ptr<GPUColumn>> &group_by_keys, v
259260
} else if (aggregate_type == ColumnType::FLOAT64) {
260261
ResolveTypeGroupByString<double>(group_by_keys, aggregate_keys, gpuBufferManager, aggregates, num_group_keys);
261262
} else {
262-
throw NotImplementedException("Unsupported column type");
263+
throw NotImplementedException("Unsupported column type in `HandleGroupByAggregateExpression`: {}",
264+
static_cast<int>(aggregate_type));
263265
}
264266
} else {
265267
//check if all the group by keys are all integers
@@ -274,12 +276,13 @@ HandleGroupByAggregateExpression(vector<shared_ptr<GPUColumn>> &group_by_keys, v
274276
ResolveTypeGroupByAggregateExpression<uint64_t, uint64_t>(group_by_keys, aggregate_keys, gpuBufferManager, aggregates, num_group_keys);
275277
} else if (aggregate_type == ColumnType::FLOAT64) {
276278
ResolveTypeGroupByAggregateExpression<uint64_t, double>(group_by_keys, aggregate_keys, gpuBufferManager, aggregates, num_group_keys);
277-
} else throw NotImplementedException("Unsupported column type");
279+
} else throw NotImplementedException("Unsupported column type in `HandleGroupByAggregateExpression`: {}",
280+
static_cast<int>(aggregate_type));
278281
break;
279282
case ColumnType::FLOAT64:
280-
throw NotImplementedException("Unsupported column type");
281283
default:
282-
throw NotImplementedException("Unsupported column type");
284+
throw NotImplementedException("Unsupported column type in `HandleGroupByAggregateExpression`: {}",
285+
static_cast<int>(group_by_keys[0]->data_wrapper.type));
283286
}
284287
}
285288
}
@@ -349,9 +352,9 @@ void HandleDuplicateElimination(vector<shared_ptr<GPUColumn>> &group_by_keys, GP
349352
ResolveTypeDuplicateElimination<uint64_t>(group_by_keys, gpuBufferManager, num_group_keys);
350353
break;
351354
case ColumnType::FLOAT64:
352-
throw NotImplementedException("Unsupported column type");
353355
default:
354-
throw NotImplementedException("Unsupported column type");
356+
throw NotImplementedException("Unsupported column type in `HandleDuplicateElimination`: %d",
357+
static_cast<int>(group_by_keys[0]->data_wrapper.type));
355358
}
356359
}
357360

@@ -414,12 +417,13 @@ void HandleDistinctGroupBy(vector<shared_ptr<GPUColumn>> &group_by_keys, vector<
414417
case ColumnType::INT64: {
415418
if (aggregate_keys[0]->data_wrapper.type == ColumnType::INT64) {
416419
ResolveTypeDistinctGroupBy<uint64_t, uint64_t>(group_by_keys, aggregate_keys, gpuBufferManager, distinct_info, num_group_keys);
417-
} else throw NotImplementedException("Unsupported column type");
420+
} else throw NotImplementedException("Unsupported column type in `HandleDistinctGroupBy`: %d",
421+
static_cast<int>(aggregate_keys[0]->data_wrapper.type));
418422
break;
419423
} case ColumnType::FLOAT64:
420-
throw NotImplementedException("Unsupported column type");
421424
default:
422-
throw NotImplementedException("Unsupported column type");
425+
throw NotImplementedException("Unsupported column type in `HandleDistinctGroupBy`: %d",
426+
static_cast<int>(group_by_keys[0]->data_wrapper.type));
423427
}
424428
}
425429

src/operator/gpu_physical_hash_join.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ HandleProbeExpression(vector<shared_ptr<GPUColumn>> &probe_keys, uint64_t* &coun
7272
ResolveTypeProbeExpression(probe_keys, count, row_ids_left, row_ids_right, ht, ht_len, conditions, join_type, unique_build_keys, gpuBufferManager);
7373
break;
7474
default:
75-
throw NotImplementedException("Unsupported column type");
75+
throw NotImplementedException("Unsupported column type in `HandleProbeExpression`: %d",
76+
static_cast<int>(probe_keys[0]->data_wrapper.type));
7677
}
7778
}
7879

@@ -112,9 +113,9 @@ HandleMarkExpression(vector<shared_ptr<GPUColumn>> &probe_keys, uint8_t* &output
112113
ResolveTypeMarkExpression(probe_keys, output, ht, ht_len, conditions, gpuBufferManager);
113114
break;
114115
case ColumnType::FLOAT64:
115-
throw NotImplementedException("Unsupported column type");
116116
default:
117-
throw NotImplementedException("Unsupported column type");
117+
throw NotImplementedException("Unsupported column type in `HandleMarkExpression`: %d",
118+
static_cast<int>(probe_keys[0]->data_wrapper.type));
118119
}
119120
}
120121

@@ -162,7 +163,8 @@ HandleBuildExpression(vector<shared_ptr<GPUColumn>> &build_keys, unsigned long l
162163
ResolveTypeBuildExpression(build_keys, ht, ht_len, conditions, join_type, gpuBufferManager);
163164
break;
164165
default:
165-
throw NotImplementedException("Unsupported column type");
166+
throw NotImplementedException("Unsupported column type in `HandleBuildExpression`: %d",
167+
static_cast<int>(build_keys[0]->data_wrapper.type));
166168
}
167169
}
168170

src/operator/gpu_physical_nested_loop_join.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ HandleNestedLoopJoin(vector<shared_ptr<GPUColumn>> &left_keys, vector<shared_ptr
6767
ResolveTypeNestedLoopJoin<double>(left_keys, right_keys, count, row_ids_left, row_ids_right, conditions, join_type, gpuBufferManager);
6868
break;
6969
default:
70-
throw NotImplementedException("Unsupported column type");
70+
throw NotImplementedException("Unsupported column type in `HandleNestedLoopJoin`: %d",
71+
static_cast<int>(left_keys[0]->data_wrapper.type));
7172
}
7273
}
7374

src/operator/gpu_physical_result_collector.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ GPUPhysicalMaterializedCollector::FinalMaterialize(GPUIntermediateRelation input
155155
FinalMaterializeString(input_relation, output_relation, col);
156156
break;
157157
default:
158-
throw NotImplementedException("Unsupported column type");
158+
throw NotImplementedException("Unsupported column type in `FinalMaterialize`: %d",
159+
static_cast<int>(input_relation.columns[col]->data_wrapper.type));
159160
}
160161
// output_relation.length = output_relation.columns[col]->column_length;
161162
// SIRIUS_LOG_DEBUG("Final materialize size {} bytes", size_bytes);
@@ -177,7 +178,8 @@ LogicalType ColumnTypeToLogicalType(ColumnType type) {
177178
case ColumnType::VARCHAR:
178179
return LogicalType::VARCHAR;
179180
default:
180-
throw NotImplementedException("Unsupported column type");
181+
throw NotImplementedException("Unsupported column type in `ColumnTypeToLogicalType`: %d",
182+
static_cast<int>(type));
181183
}
182184
}
183185

@@ -195,7 +197,8 @@ Vector rawDataToVector(uint8_t* host_data, size_t vector_offset, ColumnType type
195197
case ColumnType::BOOLEAN:
196198
sizeof_type = sizeof(uint8_t); break;
197199
default:
198-
throw NotImplementedException("Unsupported column type");
200+
throw NotImplementedException("Unsupported column type in `rawDataToVector`: %d",
201+
static_cast<int>(type));
199202
}
200203
uint8_t* data = host_data + vector_offset * STANDARD_VECTOR_SIZE * sizeof_type;
201204
return Vector(ColumnTypeToLogicalType(type), data);

src/operator/gpu_physical_result_collector_opt.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ GPUPhysicalMaterializedCollector::FinalMaterialize(GPUIntermediateRelation input
160160
FinalMaterializeString(input_relation, output_relation, col);
161161
break;
162162
default:
163-
throw NotImplementedException("Unsupported column type");
163+
throw NotImplementedException("Unsupported column type in `FinalMaterialize`: %d",
164+
static_cast<int>(input_relation.columns[col]->data_wrapper.type));
164165
}
165166
// output_relation.length = output_relation.columns[col]->column_length;
166167
// SIRIUS_LOG_DEBUG("Final materialize size {} bytes", size_bytes);
@@ -182,7 +183,8 @@ LogicalType ColumnTypeToLogicalType(ColumnType type) {
182183
case ColumnType::VARCHAR:
183184
return LogicalType::VARCHAR;
184185
default:
185-
throw NotImplementedException("Unsupported column type");
186+
throw NotImplementedException("Unsupported column type in `ColumnTypeToLogicalType`: %d",
187+
static_cast<int>(type));
186188
}
187189
}
188190

@@ -200,7 +202,8 @@ Vector rawDataToVector(uint8_t* host_data, size_t vector_offset, ColumnType type
200202
case ColumnType::BOOLEAN:
201203
sizeof_type = sizeof(uint8_t); break;
202204
default:
203-
throw NotImplementedException("Unsupported column type");
205+
throw NotImplementedException("Unsupported column type in `rawDataToVector`: %d",
206+
static_cast<int>(type));
204207
}
205208
uint8_t* data = host_data + vector_offset * STANDARD_VECTOR_SIZE * sizeof_type;
206209
return Vector(ColumnTypeToLogicalType(type), data);

src/operator/gpu_physical_table_scan.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ void HandleComparisonConstantExpression(shared_ptr<GPUColumn> column, uint64_t*
117117
ResolveStringExpression(column, count, row_ids, filter_constant, expression_type);
118118
break;
119119
default:
120-
throw NotImplementedException("Unsupported column type");
120+
throw NotImplementedException("Unsupported column type in `HandleComparisonConstantExpression`: %d",
121+
static_cast<int>(column->data_wrapper.type));
121122
}
122123
}
123124

@@ -176,7 +177,8 @@ void HandleBetweenExpression(shared_ptr<GPUColumn> column, uint64_t* &count, uin
176177
ResolveStringBetweenExpression(column, count, row_ids, filter_constant1, filter_constant2);
177178
break;
178179
default:
179-
throw NotImplementedException("Unsupported column type");
180+
throw NotImplementedException("Unsupported column type in `HandleBetweenExpression`: %d",
181+
static_cast<int>(column->data_wrapper.type));
180182
}
181183
}
182184

@@ -242,7 +244,8 @@ HandleMaterializeExpression(shared_ptr<GPUColumn> column, GPUBufferManager* gpuB
242244
case ColumnType::VARCHAR:
243245
return ResolveStringMateralizeExpression(column, gpuBufferManager);
244246
default:
245-
throw NotImplementedException("Unsupported column type");
247+
throw NotImplementedException("Unsupported column type in `HandleMaterializeExpression`: %d",
248+
static_cast<int>(column->data_wrapper.type));
246249
}
247250
}
248251

@@ -304,7 +307,8 @@ void HandleArbitraryConstantExpression(vector<shared_ptr<GPUColumn>> &column, ui
304307
data_type[expr] = VARCHAR;
305308
break;
306309
} default: {
307-
throw NotImplementedException("Unsupported column type");
310+
throw NotImplementedException("Unsupported column type in `HandleArbitraryConstantExpression`: %d",
311+
static_cast<int>(column[expr]->data_wrapper.type));
308312
}
309313
}
310314
}
@@ -348,7 +352,8 @@ void HandleArbitraryConstantExpression(vector<shared_ptr<GPUColumn>> &column, ui
348352
init_offset += lower_string.size();
349353
break;
350354
} default: {
351-
throw NotImplementedException("Unsupported column type");
355+
throw NotImplementedException("Unsupported column type in `HandleArbitraryConstantExpression`: %d",
356+
column[expr]->data_wrapper.type);
352357
}
353358
}
354359
}

src/operator/gpu_physical_ungrouped_aggregate.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ HandleAggregateExpression(vector<shared_ptr<GPUColumn>> &aggregate_keys, GPUBuff
9898
ResolveTypeAggregateExpression<double>(aggregate_keys, gpuBufferManager, aggregates);
9999
break;
100100
default:
101-
throw NotImplementedException("Unsupported column type");
101+
throw NotImplementedException("Unsupported column type in `HandleAggregateExpression`: %d",
102+
static_cast<int>(aggregate_keys[0]->data_wrapper.type));
102103
}
103104
}
104105

0 commit comments

Comments
 (0)