Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit 1006e9b

Browse files
committed
Fix warnings.
Signed-off-by: ienkovich <[email protected]>
1 parent 658eb83 commit 1006e9b

File tree

10 files changed

+35
-53
lines changed

10 files changed

+35
-53
lines changed

omniscidb/DataMgr/DataMgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ std::vector<Buffer_Namespace::MemoryInfo> DataMgr::getMemoryInfo(
352352
mem_info.push_back(cpu_buffer->getMemoryInfo());
353353
} else if (has_gpus_) {
354354
int num_gpus = getGpuMgr()->getDeviceCount();
355-
CHECK_EQ(num_gpus, bufferMgrs_[MemoryLevel::GPU_LEVEL].size());
355+
CHECK_EQ(static_cast<size_t>(num_gpus), bufferMgrs_[MemoryLevel::GPU_LEVEL].size());
356356
for (int gpu_num = 0; gpu_num < num_gpus; ++gpu_num) {
357357
Buffer_Namespace::BufferMgr* gpu_buffer =
358358
dynamic_cast<Buffer_Namespace::BufferMgr*>(

omniscidb/IR/Datum.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,6 @@ std::string DatumToString(Datum d, const hdk::ir::Type* type) {
433433
return "f";
434434
case hdk::ir::Type::kDecimal: {
435435
CHECK_EQ(type->size(), 8);
436-
auto precision = type->as<hdk::ir::DecimalType>()->precision();
437436
auto scale = type->as<hdk::ir::DecimalType>()->scale();
438437
double v = (double)d.bigintval / pow(10, scale);
439438
int size = snprintf(buf, buf_size, "%.*f", scale, v);

omniscidb/QueryEngine/Execute.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2802,7 +2802,6 @@ FetchResult Executor::fetchChunks(
28022802
if (col_id->isVirtual()) {
28032803
continue;
28042804
}
2805-
const int table_id = col_id->getTableId();
28062805
const auto fragments_it = all_tables_fragments.find(col_id->getTableRef());
28072806
CHECK(fragments_it != all_tables_fragments.end());
28082807
const auto fragments = fragments_it->second;
@@ -3604,7 +3603,7 @@ llvm::Value* Executor::castToIntPtrTyIn(llvm::Value* val, const size_t bitWidth)
36043603
CHECK(val->getType()->isPointerTy());
36053604

36063605
const auto val_ptr_type = static_cast<llvm::PointerType*>(val->getType());
3607-
const auto val_type = val_ptr_type->getElementType();
3606+
const auto val_type = val_ptr_type->getPointerElementType();
36083607
size_t val_width = 0;
36093608
if (val_type->isIntegerTy()) {
36103609
val_width = val_type->getIntegerBitWidth();

omniscidb/QueryEngine/LoopControlFlow/JoinLoop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ llvm::BasicBlock* JoinLoop::codegen(
146146
CHECK(iteration_domain.values_buffer->getType()->isPointerTy());
147147
const auto ptr_type =
148148
static_cast<llvm::PointerType*>(iteration_domain.values_buffer->getType());
149-
if (ptr_type->getElementType()->isArrayTy()) {
149+
if (ptr_type->getPointerElementType()->isArrayTy()) {
150150
iteration_val = builder.CreateGEP(
151151
iteration_domain.values_buffer->getType()
152152
->getScalarType()

omniscidb/QueryEngine/QueryTemplateGenerator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ inline llvm::Type* get_pointer_element_type(llvm::Value* value) {
3838
CHECK(type && type->isPointerTy());
3939
auto pointer_type = llvm::dyn_cast<llvm::PointerType>(type);
4040
CHECK(pointer_type);
41-
return pointer_type->getElementType();
41+
return pointer_type->getPointerElementType();
4242
}
4343

4444
template <class Attributes>
@@ -614,7 +614,7 @@ class GroupByQueryTemplateGenerator : public QueryTemplateGenerator {
614614
// make the varlen buffer the _first_ 8 byte value in the group by buffers double
615615
// ptr, and offset the group by buffers index by 8 bytes
616616
auto varlen_output_buffer_gep = llvm::GetElementPtrInst::Create(
617-
Ty->getElementType(),
617+
Ty->getPointerElementType(),
618618
output_buffers,
619619
llvm::ConstantInt::get(llvm::Type::getInt32Ty(mod->getContext()), 0),
620620
"",
@@ -641,7 +641,7 @@ class GroupByQueryTemplateGenerator : public QueryTemplateGenerator {
641641
CHECK(!pos_start_i64);
642642
pos_start_i64 = new llvm::SExtInst(pos_start, i64_type, "pos_start_i64", bb_entry);
643643
llvm::GetElementPtrInst* group_by_buffers_gep = llvm::GetElementPtrInst::Create(
644-
Ty->getElementType(), output_buffers, group_buff_idx, "", bb_entry);
644+
Ty->getPointerElementType(), output_buffers, group_buff_idx, "", bb_entry);
645645
col_buffer = new llvm::LoadInst(get_pointer_element_type(group_by_buffers_gep),
646646
group_by_buffers_gep,
647647
"col_buffer",

omniscidb/QueryEngine/RelAlgExecutor.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,6 @@ bool RelAlgExecutor::isRowidLookup(const WorkUnit& work_unit) {
12391239
if (ra_exe_unit.input_descs.size() != 1) {
12401240
return false;
12411241
}
1242-
const auto& table_desc = ra_exe_unit.input_descs.front();
12431242
for (const auto& simple_qual : ra_exe_unit.simple_quals) {
12441243
const auto comp_expr = std::dynamic_pointer_cast<const hdk::ir::BinOper>(simple_qual);
12451244
if (!comp_expr || !comp_expr->isEq()) {

omniscidb/QueryEngine/WorkUnitBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class NestLevelRewriter : public ir::ExprRewriter {
6262

6363
ir::ExprPtr visitColumnVar(const ir::ColumnVar* col_var) override {
6464
int old_rte_idx = col_var->rteIdx();
65-
if (old_rte_idx < permutation_.size()) {
65+
if (old_rte_idx < static_cast<int>(permutation_.size())) {
6666
int new_rte_idx = static_cast<int>(permutation_.at(old_rte_idx));
6767
if (new_rte_idx != old_rte_idx) {
6868
return ir::makeExpr<ir::ColumnVar>(col_var->columnInfo(), new_rte_idx);
@@ -73,7 +73,7 @@ class NestLevelRewriter : public ir::ExprRewriter {
7373

7474
ir::ExprPtr visitVar(const ir::Var* var) override {
7575
int old_rte_idx = var->rteIdx();
76-
if (old_rte_idx < permutation_.size()) {
76+
if (old_rte_idx < static_cast<int>(permutation_.size())) {
7777
int new_rte_idx = static_cast<int>(permutation_.at(old_rte_idx));
7878
if (new_rte_idx != old_rte_idx) {
7979
return ir::makeExpr<ir::Var>(

omniscidb/StringDictionary/StringDictionary.cpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,6 @@ namespace {
5050

5151
const int SYSTEM_PAGE_SIZE = omnisci::get_page_size();
5252

53-
const uint64_t round_up_p2(const uint64_t num) {
54-
uint64_t in = num;
55-
in--;
56-
in |= in >> 1;
57-
in |= in >> 2;
58-
in |= in >> 4;
59-
in |= in >> 8;
60-
in |= in >> 16;
61-
in++;
62-
// TODO MAT deal with case where filesize has been increased but reality is
63-
// we are constrained to 2^31.
64-
// In that situation this calculation will wrap to zero
65-
if (in == 0 || (in > (UINT32_MAX))) {
66-
in = UINT32_MAX;
67-
}
68-
return in;
69-
}
70-
7153
string_dict_hash_t hash_string(const std::string_view& str) {
7254
string_dict_hash_t str_hash = 1;
7355
// rely on fact that unsigned overflow is defined and wraps
@@ -759,7 +741,7 @@ std::vector<int32_t> StringDictionary::getCompare(const std::string& pattern,
759741

760742
// since we have a cache in form of vector of ints which is sorted according to
761743
// corresponding strings in the dictionary all we need is the index of the element
762-
// which equal to the pattern that we are trying to match or the index of biggest
744+
// which equal to the pattern that we are trying to match or the index of "biggest"
763745
// element smaller than the pattern, to perform all the comparison operators over
764746
// string. The search function guarantees we have such index so now it is just the
765747
// matter to include all the elements in the result vector.
@@ -816,7 +798,7 @@ std::vector<int32_t> StringDictionary::getCompare(const std::string& pattern,
816798
// For >= operator when the indexed element that we have points to element which is
817799
// equal to the pattern we are searching for we want to include that in the result
818800
// vector. If the index that we have does not point to the string which is equal to
819-
// the pattern we are searching we dont want to include that id into the result
801+
// the pattern we are searching we don't want to include that id into the result
820802
// vector except when the index is 0.
821803

822804
} else if (comp_operator == ">=") {

omniscidb/Tests/ArrowBasedExecuteTest.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <boost/algorithm/string.hpp>
2828
#include <boost/any.hpp>
2929
#include <boost/config/pragma_message.hpp>
30+
#include <boost/core/ignore_unused.hpp>
3031
#include <boost/crc.hpp>
3132
#include <boost/program_options.hpp>
3233

@@ -9553,6 +9554,8 @@ TEST_F(Select, Joins_FilterPushDown) {
95539554
#if 0
95549555
config().opts.filter_pushdown.enable = fpd.first;
95559556
config().opts.filter_pushdown.low_frac = fpd.second;
9557+
#else
9558+
boost::ignore_unused(fpd);
95569559
#endif
95579560
c("SELECT COUNT(*) FROM coalesce_cols_test_2 AS R, coalesce_cols_test_0 AS S "
95589561
"WHERE R.y = S.y AND R.x > 2 AND (S.x > 1 OR S.y < 18);",

omniscidb/Tests/ResultSetArrowConversion.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ constexpr TYPE null_builder() {
167167
template <typename TYPE, size_t len>
168168
void compare_columns(const std::array<TYPE, len>& expected,
169169
const std::shared_ptr<arrow::ChunkedArray>& actual) {
170-
ASSERT_EQ(expected.size(), actual->length());
170+
ASSERT_EQ(expected.size(), static_cast<size_t>(actual->length()));
171171

172172
using ArrowColType = arrow::NumericArray<typename arrow::CTypeTraits<TYPE>::ArrowType>;
173173
const arrow::ArrayVector& chunks = actual->chunks();
@@ -417,7 +417,7 @@ TEST(ArrowTable, LimitedSelection) {
417417
auto res = runSqlQuery("select i, count(bi) from test group by i limit 4 offset 1;",
418418
ExecutorDeviceType::CPU,
419419
true);
420-
ASSERT_EQ(res.getRows()->rowCount(), (int64_t)1);
420+
ASSERT_EQ(res.getRows()->rowCount(), (size_t)1);
421421

422422
auto table = getArrowTable(res);
423423
ASSERT_NE(table, nullptr);
@@ -452,9 +452,9 @@ TEST(ArrowTable, SameLimitedOffsetSelection) {
452452

453453
auto res = runSqlQuery(
454454
"SELECT * FROM LargeTable offset 2 limit 2;", ExecutorDeviceType::CPU, true);
455-
ASSERT_EQ(res.getRows()->getLimit(), 2);
456-
ASSERT_EQ(res.getRows()->getOffset(), 2);
457-
ASSERT_EQ(res.getRows()->rowCount(), (int64_t)2);
455+
ASSERT_EQ(res.getRows()->getLimit(), (size_t)2);
456+
ASSERT_EQ(res.getRows()->getOffset(), (size_t)2);
457+
ASSERT_EQ(res.getRows()->rowCount(), (size_t)2);
458458
ASSERT_EQ(res.getRows()->isChunkedZeroCopyColumnarConversionPossible(0), true);
459459

460460
auto table = getArrowTable(res);
@@ -471,7 +471,7 @@ TEST(ArrowTable, OrderedLimitedSelection) {
471471
auto res = runSqlQuery("select d, bi from test order by bi desc limit 4 offset 2;",
472472
ExecutorDeviceType::CPU,
473473
true);
474-
ASSERT_EQ(res.getRows()->rowCount(), (int64_t)4);
474+
ASSERT_EQ(res.getRows()->rowCount(), (size_t)4);
475475

476476
auto table = getArrowTable(res);
477477
ASSERT_NE(table, nullptr);
@@ -510,9 +510,9 @@ TEST(ArrowTable, ColumnarLimitedJoin) {
510510
ExecutorDeviceType::CPU,
511511
true);
512512

513-
ASSERT_EQ(res.getRows()->getLimit(), 2);
514-
ASSERT_EQ(res.getRows()->getOffset(), 5);
515-
ASSERT_EQ(res.getRows()->rowCount(), (int64_t)1);
513+
ASSERT_EQ(res.getRows()->getLimit(), (size_t)2);
514+
ASSERT_EQ(res.getRows()->getOffset(), (size_t)5);
515+
ASSERT_EQ(res.getRows()->rowCount(), (size_t)1);
516516
ASSERT_EQ(res.getRows()->isChunkedZeroCopyColumnarConversionPossible(1), true);
517517
ASSERT_EQ(res.getRows()->isChunkedZeroCopyColumnarConversionPossible(2), true);
518518
ASSERT_EQ(res.getRows()->isChunkedZeroCopyColumnarConversionPossible(3), true);
@@ -559,9 +559,9 @@ TEST(ArrowTable, ColumnarEmptyLimitedJoin) {
559559
auto res = runSqlQuery(
560560
"SELECT * FROM test_chunked offset 8 limit 2;", ExecutorDeviceType::CPU, true);
561561

562-
ASSERT_EQ(res.getRows()->getLimit(), 2);
563-
ASSERT_EQ(res.getRows()->getOffset(), 8);
564-
ASSERT_EQ(res.getRows()->rowCount(), (int64_t)0);
562+
ASSERT_EQ(res.getRows()->getLimit(), (size_t)2);
563+
ASSERT_EQ(res.getRows()->getOffset(), (size_t)8);
564+
ASSERT_EQ(res.getRows()->rowCount(), (size_t)0);
565565

566566
auto table = getArrowTable(res);
567567
ASSERT_NE(table, nullptr);
@@ -583,9 +583,9 @@ TEST(ArrowTable, ColumnarMultiStoragedJoin) {
583583
auto res = runSqlQuery(
584584
"SELECT * FROM test_chunked offset 3 limit 7;", ExecutorDeviceType::CPU, true);
585585

586-
ASSERT_EQ(res.getRows()->getLimit(), 7);
587-
ASSERT_EQ(res.getRows()->getOffset(), 3);
588-
ASSERT_EQ(res.getRows()->rowCount(), (int64_t)3);
586+
ASSERT_EQ(res.getRows()->getLimit(), (size_t)7);
587+
ASSERT_EQ(res.getRows()->getOffset(), (size_t)3);
588+
ASSERT_EQ(res.getRows()->rowCount(), (size_t)3);
589589
ASSERT_EQ(res.getRows()->isChunkedZeroCopyColumnarConversionPossible(1), true);
590590
ASSERT_EQ(res.getRows()->isChunkedZeroCopyColumnarConversionPossible(2), true);
591591
ASSERT_EQ(res.getRows()->isChunkedZeroCopyColumnarConversionPossible(3), true);
@@ -619,9 +619,9 @@ TEST(ArrowTable, ColumnarMultiStoraged) {
619619
auto res = runSqlQuery(
620620
"SELECT * FROM test_chunked offset 5 limit 7;", ExecutorDeviceType::CPU, true);
621621

622-
ASSERT_EQ(res.getRows()->getLimit(), 7);
623-
ASSERT_EQ(res.getRows()->getOffset(), 5);
624-
ASSERT_EQ(res.getRows()->rowCount(), (int64_t)1);
622+
ASSERT_EQ(res.getRows()->getLimit(), (size_t)7);
623+
ASSERT_EQ(res.getRows()->getOffset(), (size_t)5);
624+
ASSERT_EQ(res.getRows()->rowCount(), (size_t)1);
625625
ASSERT_EQ(res.getRows()->isChunkedZeroCopyColumnarConversionPossible(1), true);
626626
ASSERT_EQ(res.getRows()->isChunkedZeroCopyColumnarConversionPossible(2), true);
627627
ASSERT_EQ(res.getRows()->isChunkedZeroCopyColumnarConversionPossible(3), true);
@@ -664,9 +664,9 @@ TEST(ArrowTable, ColumnarLargeStoraged) {
664664
auto res = runSqlQuery(
665665
"SELECT * FROM LargeTable offset 7000 limit 3000;", ExecutorDeviceType::CPU, true);
666666

667-
ASSERT_EQ(res.getRows()->getLimit(), 3000);
668-
ASSERT_EQ(res.getRows()->getOffset(), 7000);
669-
ASSERT_EQ(res.getRows()->rowCount(), (int64_t)3000);
667+
ASSERT_EQ(res.getRows()->getLimit(), (size_t)3000);
668+
ASSERT_EQ(res.getRows()->getOffset(), (size_t)7000);
669+
ASSERT_EQ(res.getRows()->rowCount(), (size_t)3000);
670670
ASSERT_EQ(res.getRows()->isChunkedZeroCopyColumnarConversionPossible(0), true);
671671

672672
auto table = getArrowTable(res);
@@ -683,7 +683,7 @@ TEST(ArrowTable, OrderedLimitOverSizeSelection) {
683683
auto res = runSqlQuery("select bi from test order by bi desc limit 7 offset 2;",
684684
ExecutorDeviceType::CPU,
685685
true);
686-
ASSERT_EQ(res.getRows()->rowCount(), (int64_t)4);
686+
ASSERT_EQ(res.getRows()->rowCount(), (size_t)4);
687687

688688
auto table = getArrowTable(res);
689689
ASSERT_NE(table, nullptr);

0 commit comments

Comments
 (0)