Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
pdabre12 authored and Pratik Joseph Dabre committed Aug 6, 2024
1 parent 84d988c commit 8a5fe7c
Show file tree
Hide file tree
Showing 133 changed files with 2,924 additions and 1,892 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ add_library(presto_tpcds_connector OBJECT tpcds/TpcdsConnector.cpp)

target_link_libraries(presto_tpcds_connector velox_connector tpcds_gen fmt::fmt)

# if(${VELOX_ENABLE_TPCDS_CONNECTOR}) # make this change to a presto flag
add_subdirectory(tpcds)
# endif()

Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,9 @@ cmake_policy(SET CMP0063 NEW)

project(TPCDS)

# Certain Clang compiler versions throw "deprecated declarations" warnings for
# DuckDB's parquet-amalgamation.h. This warning is from the Thrift library that
# DuckDB embeds and is also on Thrift master. The workaround, for now, is to
# disable this warning if the compiler is Clang.
check_cxx_compiler_flag(-Wno-unqualified-std-cast-call UNQUALIFIED_STD_CAST)
check_cxx_compiler_flag(-Wno-bitwise-instead-of-logical
BITWISE_INSTEAD_OF_LOGICAL)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-deprecated-declarations -Wno-writable-strings
-Wno-missing-field-initializers)
if(UNQUALIFIED_STD_CAST)
add_compile_options(-Wno-unqualified-std-cast-call)
endif()
if(BITWISE_INSTEAD_OF_LOGICAL)
add_compile_options(-Wno-bitwise-instead-of-logical)
endif()
endif()

# This stringop-overflow warning seems to have lots of false positives and has
Expand All @@ -41,7 +28,7 @@ endif()
# parquet-amalgamation.cpp to fail to compile. For now, we disable this warning
# on the affected compiler (GCC).
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
add_compile_options(-Wno-stringop-overflow)
add_compile_options(-Wno-stringop-overflow -Wno-write-strings)
endif()

include_directories(dsdgen/include)
Expand All @@ -51,11 +38,11 @@ include_directories(..)

add_subdirectory(dsdgen/dsdgen-c)

target_link_libraries(dsdgen_c velox_vector_test_lib Folly::folly xsimd)

add_library(dsdgen STATIC include/append_info-c.cpp)
target_link_libraries(dsdgen dsdgen_c velox_vector_test_lib Folly::folly xsimd)
target_link_libraries(dsdgen dsdgen_c)

add_library(tpcds_gen TpcdsGen.cpp DSDGenIterator.cpp)
target_include_directories(tpcds_gen PRIVATE dsdgen/include)
target_link_libraries(tpcds_gen velox_memory velox_vector dsdgen fmt::fmt)

# if(${VELOX_BUILD_TESTING}) add_subdirectory(tests) endif()
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand All @@ -14,8 +12,7 @@
* limitations under the License.
*/

#define DECLARER
#include "presto_cpp/main/connectors/tpcds/DSDGenIterator.h"
#include "DSDGenIterator.h"
#include "address.h"
#include "build_support.h"
#include "config.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand All @@ -17,7 +15,6 @@
#pragma once

#include <memory>
#include <mutex>

#include <presto_cpp/main/connectors/tpcds/dsdgen/include/dsdgen-c/dist.h>
#include <presto_cpp/main/connectors/tpcds/dsdgen/include/tpcds_constants.hpp>
Expand All @@ -29,7 +26,11 @@ typedef int64_t ds_key_t;

typedef int (*tpcds_builder_func)(void*, ds_key_t, DSDGenContext& dsdgenCtx);

void InitializeDSDgen(DSDGenContext& dsdGenContext);
void InitializeDSDgen(
double scale,
vector_size_t parallel,
vector_size_t child,
DSDGenContext& dsdGenContext);

std::string getQuery(int query);

Expand All @@ -49,11 +50,11 @@ class DSDGenIterator {
// Before generating records using the gen*() functions below, call the
// appropriate init*() function to correctly initialize the seed given the
// offset to be generated.
// void initCallCenter(size_t offset);
void initTableOffset(int32_t table_id, size_t offset);

// Generate different types of records.
void genRow(int32_t table_id, size_t index);
void initTableOffset(int32_t table_id, size_t offset);

ds_key_t getRowCount(int32_t table_id);

tpcds_builder_func GetTDefFunctionByNumber(int table_id);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand All @@ -14,8 +12,8 @@
* limitations under the License.
*/

#include "presto_cpp/main/connectors/tpcds/TpcdsConnector.h"
#include "presto_cpp/main/connectors/tpcds/DSDGenIterator.h"
#include "TpcdsConnector.h"
#include "DSDGenIterator.h"

using namespace ::facebook::velox::tpcds;
namespace facebook::velox::connector::tpcds {
Expand Down Expand Up @@ -86,7 +84,8 @@ RowVectorPtr getTpcdsData(
return genTpcdsStoreSales(
pool, maxRows, offset, scaleFactor, parallel, child);
case Table::TBL_TIME_DIM:
return genTpcdsTimeDim(pool, maxRows, offset, scaleFactor, parallel, child);
return genTpcdsTimeDim(
pool, maxRows, offset, scaleFactor, parallel, child);
case Table::TBL_WAREHOUSE:
return genTpcdsWarehouse(
pool, maxRows, offset, scaleFactor, parallel, child);
Expand All @@ -99,8 +98,8 @@ RowVectorPtr getTpcdsData(
case Table::TBL_WEB_SALES:
return genTpcdsWebSales(
pool, maxRows, offset, scaleFactor, parallel, child);
case Table::TBL_WEBSITE:
return genTpcdsWebsite(
case Table::TBL_WEB_SITE:
return genTpcdsWebSite(
pool, maxRows, offset, scaleFactor, parallel, child);
default:
return nullptr;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand All @@ -13,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include "presto_cpp/main/connectors/tpcds/TpcdsConnectorSplit.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
Expand All @@ -13,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include <fmt/format.h>
Expand Down
Loading

0 comments on commit 8a5fe7c

Please sign in to comment.