Skip to content

Commit

Permalink
Made some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pdabre12 authored and Pratik Joseph Dabre committed Sep 24, 2024
1 parent 9dba598 commit 5ff51ef
Show file tree
Hide file tree
Showing 10 changed files with 50 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,7 @@ public static DistributedQueryRunner createQueryRunner(
queryRunner.installPlugin(new TpcdsPlugin());
queryRunner.installPlugin(new TestingHiveEventListenerPlugin());
queryRunner.createCatalog("tpch", "tpch");
Map<String, String> tpcdsProperties = ImmutableMap.<String, String>builder()
.put("tpcds.toggle-char-to-varchar", "true")
.build();
queryRunner.createCatalog("tpcds", "tpcds", tpcdsProperties);
queryRunner.createCatalog("tpcds", "tpcds");
Map<String, String> tpchProperties = ImmutableMap.<String, String>builder()
.put("tpch.column-naming", "standard")
.build();
Expand Down
2 changes: 2 additions & 0 deletions presto-native-execution/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ option(PRESTO_ENABLE_TESTING "Enable tests" ON)

option(PRESTO_ENABLE_JWT "Enable JWT (JSON Web Token) authentication" OFF)

option(PRESTO_ENABLE_TPCDS_CONNECTOR "Enable TPC-DS connector." OFF)

# Set all Velox options below
add_compile_definitions(FOLLY_HAVE_INT128_T=1)

Expand Down
6 changes: 5 additions & 1 deletion presto-native-execution/presto_cpp/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ 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 presto_tpcds_connector)
velox_tpch_connector)

if(${PRESTO_ENABLE_TPCDS_CONNECTOR})
target_link_libraries(presto_server presto_server_lib presto_tpcds_connector)
endif()

if(PRESTO_ENABLE_REMOTE_FUNCTIONS)
add_library(presto_server_remote_function JsonSignatureParser.cpp
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

add_subdirectory(tpcds)
if(${PRESTO_ENABLE_TPCDS_CONNECTOR})
add_subdirectory(tpcds)
endif()

5 changes: 4 additions & 1 deletion presto-native-execution/presto_cpp/main/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ 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 All @@ -49,6 +48,10 @@ target_link_libraries(
GTest::gtest
GTest::gtest_main)

if(${PRESTO_ENABLE_TPCDS_CONNECTOR})
target_link_libraries(presto_server_test presto_tpcds_connector)
endif()

set_property(TARGET presto_server_test PROPERTY JOB_POOL_LINK
presto_link_job_pool)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <velox/type/fbhive/HiveTypeParser.h>
#include "presto_cpp/main/connectors/tpcds/TpcdsConnector.h"
#include "presto_cpp/main/connectors/tpcds/TpcdsConnectorSplit.h"
#include "presto_cpp/main/connectors/tpcds/TpcdsGen.h"
#include "velox/connectors/hive/HiveConnector.h"
#include "velox/connectors/hive/HiveConnectorSplit.h"
#include "velox/connectors/hive/HiveDataSink.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ target_link_libraries(
$<TARGET_OBJECTS:presto_type_converter>
$<TARGET_OBJECTS:presto_types>
presto_operators
presto_tpcds_connector
velox_core
velox_dwio_common_exception
velox_encode
Expand Down Expand Up @@ -85,10 +84,14 @@ target_link_libraries(
presto_to_velox_connector_test
presto_protocol
presto_operators
presto_tpcds_connector
presto_type_converter
presto_types
velox_hive_connector
velox_tpch_connector
GTest::gtest
GTest::gtest_main)

if(${PRESTO_ENABLE_TPCDS_CONNECTOR})
target_link_libraries(presto_to_velox_connector_test presto_tpcds_connector)
target_link_libraries(presto_velox_split_test presto_tpcds_connector)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,36 @@

import com.facebook.presto.testing.ExpectedQueryRunner;
import com.facebook.presto.testing.QueryRunner;
import com.facebook.presto.tests.DistributedQueryRunner;
import com.google.common.collect.ImmutableMap;

import java.util.Map;

public class TestPrestoNativeTpcdsConnectorQueries
extends AbstractTestNativeTpcdsConnectorQueries
{
private static QueryRunner createTpcdsCatalog(QueryRunner queryRunner)
{
Map<String, String> tpcdsProperties = ImmutableMap.<String, String>builder()
.put("tpcds.toggle-char-to-varchar", "true")
.build();
queryRunner.createCatalog("tpcds", "tpcds", tpcdsProperties);
return queryRunner;
}

@Override
protected QueryRunner createQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createNativeQueryRunner(true);
DistributedQueryRunner queryRunner = (DistributedQueryRunner) PrestoNativeQueryRunnerUtils.createNativeQueryRunner(true);
return createTpcdsCatalog(queryRunner);
}

@Override
protected ExpectedQueryRunner createExpectedQueryRunner()
throws Exception
{
return PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
DistributedQueryRunner queryRunner = (DistributedQueryRunner) PrestoNativeQueryRunnerUtils.createJavaQueryRunner();
return createTpcdsCatalog(queryRunner);
}
}

0 comments on commit 5ff51ef

Please sign in to comment.