Skip to content

Commit

Permalink
Fixed some errors in build
Browse files Browse the repository at this point in the history
  • Loading branch information
pdabre12 authored and Pratik Joseph Dabre committed Jun 25, 2024
1 parent 03214b7 commit df192c3
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 17 deletions.
2 changes: 1 addition & 1 deletion presto-native-execution/presto_cpp/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ add_executable(presto_server PrestoMain.cpp)
# "undefined reference to `vtable for velox::connector::tpch::TpchTableHandle`"
# TODO: Fix these errors.
target_link_libraries(presto_server presto_server_lib velox_hive_connector
velox_tpch_connector velox_tpcds_connector)
velox_tpch_connector presto_tpcds_connector)

if(PRESTO_ENABLE_REMOTE_FUNCTIONS)
add_library(presto_server_remote_function JsonSignatureParser.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ 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
# if(${VELOX_ENABLE_TPCDS_CONNECTOR}) # make this change to a presto flag
add_subdirectory(tpcds)
endif()
# endif()
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,8 @@ DSDGenIterator::DSDGenIterator(
double scaleFactor,
vector_size_t parallel,
vector_size_t child) {
auto dsdgenBackend = DSDGenBackendSingleton.try_get();


table_defs.resize(DBGEN_VERSION); // there are 24 TPC-DS tables

VELOX_CHECK_NOT_NULL(dsdgenBackend, "Unable to initialize dbgen's dbgunk.");
VELOX_CHECK_GE(scaleFactor, 0, "Tpch scale factor must be non-negative");
dsdgenCtx_.scaleFactor = scaleFactor;
InitializeDSDgen(scaleFactor, parallel, child, dsdgenCtx_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ RowTypePtr getTableSchema(Table table) {
"s_zip",
"s_country",
"s_gmt_offset",
"s_tax_percentage",
"s_tax_precentage",
},
{
INTEGER(),
Expand All @@ -497,7 +497,6 @@ RowTypePtr getTableSchema(Table table) {
VARCHAR(),
INTEGER(),
VARCHAR(),
INTEGER(),
VARCHAR(),
VARCHAR(),
VARCHAR(),
Expand All @@ -506,8 +505,8 @@ RowTypePtr getTableSchema(Table table) {
VARCHAR(),
VARCHAR(),
VARCHAR(),
// todo: change to DECIMAL(5, 2)
INTEGER(),
VARCHAR(),
DECIMAL(5, 2),
DECIMAL(5, 2),
});
return type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include "tdefs.h"

#include <stdio.h>
#include <string>

/*
* mk_store
Expand Down Expand Up @@ -380,7 +381,7 @@ int mk_w_store(void* info_arr, ds_key_t index, DSDGenContext& dsdGenContext) {
append_varchar(info, r->division_name);
append_key(info, r->company_id);
append_varchar(info, r->company_name);
append_integer(info, r->address.street_num);
append_varchar(info, std::to_string(r->address.street_num));
if (r->address.street_name2) {
sprintf(szTemp2, "%s %s", r->address.street_name1, r->address.street_name2);
append_varchar(info, szTemp2);
Expand All @@ -394,7 +395,7 @@ int mk_w_store(void* info_arr, ds_key_t index, DSDGenContext& dsdGenContext) {
sprintf(szTemp2, "%05d", r->address.zip);
append_varchar(info, szTemp2);
append_varchar(info, r->address.country);
append_integer(info, r->address.gmt_offset);
append_integer_decimal(info, r->address.gmt_offset);
append_decimal(info, &r->dTaxPercentage);

append_row_end(info);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ void append_date(append_info info, int64_t value);
void append_integer(append_info info, int32_t value);
void append_decimal(append_info info, decimal_t* val);
void append_boolean(append_info info, int32_t val);
void append_integer_decimal(append_info info, int32_t val);

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
* Contributors:
* Gradient Systems
*/
#include "dist.h"
#include "porting.h"
#ifndef W_WEB_RETURNS_H
#define W_WEB_RETURNS_H
/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,16 @@ void append_decimal(append_info info, decimal_t* val) {
}
}
append_info->colIndex++;
}

void append_integer_decimal(append_info info, int32_t value) {
auto append_info = (tpcds::tpcds_table_def*)info;
if (append_info->IsNull()) {
append_info->children[append_info->colIndex]->setNull(
append_info->rowIndex, true);
} else {
append_info->children[append_info->colIndex]->asFlatVector<int64_t>()->set(
append_info->rowIndex, (int64_t)value);
}
append_info->colIndex++;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ target_link_libraries(
$<TARGET_OBJECTS:presto_type_converter>
$<TARGET_OBJECTS:presto_types>
velox_hive_connector
presto_tpcds_connector
velox_tpch_connector
velox_presto_serializer
velox_functions_prestosql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ add_dependencies(presto_types presto_operators presto_type_converter velox_type
velox_type_fbhive velox_dwio_dwrf_proto)

target_link_libraries(presto_types presto_type_converter velox_type_fbhive
velox_hive_partition_function velox_tpch_gen)
velox_hive_partition_function velox_tpch_gen tpcds_gen)

set_property(TARGET presto_types PROPERTY JOB_POOL_LINK presto_link_job_pool)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
#include "velox/connectors/hive/TableHandle.h"
#include "velox/connectors/hive/iceberg/IcebergDeleteFile.h"
#include "velox/connectors/hive/iceberg/IcebergSplit.h"
#include "velox/connectors/tpcds/TpcdsConnector.h"
#include "velox/connectors/tpcds/TpcdsConnectorSplit.h"
#include "presto_cpp/main/connectors/tpcds/TpcdsConnector.h"
#include "presto_cpp/main/connectors/tpcds/TpcdsConnectorSplit.h"
#include "velox/connectors/tpch/TpchConnector.h"
#include "velox/connectors/tpch/TpchConnectorSplit.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ target_link_libraries(
presto_operators
presto_protocol
velox_hive_connector
presto_tpcds_connector
velox_tpch_connector
velox_exec
velox_dwio_common_exception
Expand Down Expand Up @@ -56,6 +57,7 @@ target_link_libraries(
velox_functions_prestosql
velox_functions_lib
velox_hive_connector
presto_tpcds_connector
velox_tpch_connector
velox_hive_partition_function
velox_presto_serializer
Expand Down Expand Up @@ -86,7 +88,7 @@ target_link_libraries(
presto_type_converter
presto_types
velox_hive_connector
velox_tpcds_connector
presto_tpcds_connector
velox_tpch_connector
gtest
gtest_main)

0 comments on commit df192c3

Please sign in to comment.