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

[Warns] Reduce warnings amount #523

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion omniscidb/QueryEngine/CardinalityEstimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ RelAlgExecutionUnit create_ndv_execution_unit(const RelAlgExecutionUnit& ra_exe_
auto tinfo = schema_provider->getTableInfo(outer_input_it->getDatabaseId(),
outer_input_it->getTableId());
CHECK(tinfo);
if (tinfo->row_count < config.exec.group_by.large_ndv_threshold) {
if (static_cast<int64_t>(tinfo->row_count) <
config.exec.group_by.large_ndv_threshold) {
LOG(INFO) << "Avoid large estimator because of the small input ("
<< tinfo->row_count << " rows).";
use_large_estimator = false;
Expand Down
4 changes: 4 additions & 0 deletions omniscidb/QueryEngine/DateTruncate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include <ctime>
#include <limits>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wattributes"
#define DATE_TRUNC_FUNC_JIT(funcname) \
extern "C" RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t funcname(int64_t timeval) { \
return funcname##_##impl(timeval); \
Expand Down Expand Up @@ -574,3 +576,5 @@ DateDiffHighPrecisionNullable(const hdk::ir::DateTruncField datepart,
}
return DateDiffHighPrecision(datepart, startdate, enddate, start_dim, end_dim);
}

#pragma GCC diagnostic pop
5 changes: 2 additions & 3 deletions omniscidb/QueryEngine/Execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1989,9 +1989,8 @@ Executor::getExecutionPolicyForTargets(const RelAlgExecutionUnit& ra_exe_unit,
<< toString(ra_exe_unit.templs) << " cost_model=" << ra_exe_unit.cost_model
<< ", cost model in config: "
<< (config_->exec.enable_cost_model ? "enabled" : "disabled")
<< ", heterogeneous execution: " << cfg.enable_heterogeneous_execution
? "enabled"
: "disabled";
<< ", heterogeneous execution: "
<< (cfg.enable_heterogeneous_execution ? "enabled" : "disabled");

if (cfg.enable_heterogeneous_execution) {
if (cfg.forced_heterogeneous_distribution) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ class AnnotateInternalFunctionsPass
llvm::CGSCCAnalysisManager& AM,
llvm::LazyCallGraph& CG,
llvm::CGSCCUpdateResult& UR) {
bool updated_function_defs = false;

#if 0
for (llvm::LazyCallGraph::Node& N : InitialC) {
llvm::Function* Fn = &N.getFunction();
Expand All @@ -57,7 +55,6 @@ class AnnotateInternalFunctionsPass
}
if (isInternalStatelessFunction(fcn->getName()) ||
isInternalMathFunction(fcn->getName())) {
updated_function_defs = true;
std::vector<llvm::Attribute::AttrKind> attrs{llvm::Attribute::NoFree,
llvm::Attribute::NoSync,
llvm::Attribute::NoUnwind,
Expand All @@ -68,7 +65,6 @@ class AnnotateInternalFunctionsPass
fcn->addFnAttr(attr);
}
} else if (isReadOnlyFunction(fcn->getName())) {
updated_function_defs = true;
fcn->addFnAttr(llvm::Attribute::ReadOnly);
}
}
Expand Down
3 changes: 3 additions & 0 deletions omniscidb/ResultSet/ResultSetStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ int8_t* VarlenOutputInfo::computeCpuOffset(const int64_t gpu_offset_address) con

namespace {

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wattributes"
ALWAYS_INLINE
void fill_empty_key_32(int32_t* key_ptr_i32, const size_t key_count) {
for (size_t i = 0; i < key_count; ++i) {
Expand All @@ -64,6 +66,7 @@ void fill_empty_key_64(int64_t* key_ptr_i64, const size_t key_count) {
key_ptr_i64[i] = EMPTY_KEY_64;
}
}
#pragma GCC diagnostic pop

template <typename T>
inline size_t make_bin_search(size_t l, size_t r, T&& is_empty_fn) {
Expand Down
2 changes: 0 additions & 2 deletions omniscidb/ResultSet/TargetValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include "TargetValue.h"

#include "IR/Type.h"
Expand Down
6 changes: 3 additions & 3 deletions omniscidb/Tests/ArrowStorageTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

#include "ArrowStorage/ArrowStorage.h"
#include "Shared/ArrowUtil.h"

#include "TestHelpers.h"

Expand Down Expand Up @@ -736,11 +737,10 @@ TEST_F(ArrowStorageTest, ImportArrowTable) {
ArrowStorage storage(TEST_SCHEMA_ID, "test", TEST_DB_ID, config_);
auto col_a = std::make_shared<arrow::Field>("A", arrow::null());
auto schema = arrow::schema({col_a});

std::shared_ptr<arrow::Array> empty_array;
arrow::NumericBuilder<arrow::FloatType> float64_builder;
float64_builder.AppendValues({});
float64_builder.Finish(&empty_array);
ARROW_THROW_NOT_OK(float64_builder.AppendValues({}));
ARROW_THROW_NOT_OK(float64_builder.Finish(&empty_array));
auto table = arrow::Table::Make(schema, {empty_array});
ASSERT_NO_THROW(
storage.importArrowTable(table, "test_empty", ArrowStorage::TableOptions{1}));
Expand Down
4 changes: 4 additions & 0 deletions omniscidb/Utils/ExtractFromTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ DEVICE unsigned week_start_from_yoe(unsigned const yoe) {

} // namespace

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wattributes"

extern "C" RUNTIME_EXPORT ALWAYS_INLINE DEVICE int64_t
extract_hour(const int64_t lcltime) {
return unsigned_mod(lcltime, kSecsPerDay) / kSecsPerHour;
Expand Down Expand Up @@ -267,6 +270,7 @@ extract_year(const int64_t timeval) {
return 2000 + era * 400 + yoe + (MARJAN <= doy);
}

#pragma GCC diagnostic pop
/*
* @brief support the SQL EXTRACT function
*/
Expand Down