Skip to content
Open
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
74 changes: 48 additions & 26 deletions cmake/cpack_manage.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
if(NOT RPM)
return()
endif()

# Define %ignore as a comment so RPM doesn't claim ownership of shared directories
set(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}
%define ignore \#
")

set(ignored
"%ignore /usr"
"%ignore /usr/local"
"%ignore /bin"
"%ignore /lib"
"%ignore /usr/sbin"
"%ignore /usr/lib64/mysql"
"%ignore /usr/lib64/mysql/plugin"
"%ignore /etc/my.cnf.d"
"%ignore /var/lib"
"%ignore /var"
)

set(CPACK_RPM_columnstore-engine_USER_FILELIST ${ignored})

macro(columnstore_append_for_cpack var_name)
# Get current value from parent scope or use empty string
if(DEFINED ${var_name})
Expand Down Expand Up @@ -28,31 +52,29 @@ macro(columnstore_add_rpm_deps)
columnstore_append_for_cpack(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES ${ARGN})
endmacro()

if(NOT COLUMNSTORE_MAINTAINER)
return()
endif()

# Columnstore-specific RPM packaging overrides 1) Use fast compression to speed up packaging
set(CPACK_RPM_COMPRESSION_TYPE
"zstd"
CACHE STRING "RPM payload compression" FORCE
)
# 2) Disable debuginfo/debugsource to avoid slow packaging and duplicate file warnings
set(CPACK_RPM_DEBUGINFO_PACKAGE
OFF
CACHE BOOL "Disable debuginfo package" FORCE
)
set(CPACK_RPM_PACKAGE_DEBUG
0
CACHE STRING "Disable RPM debug package" FORCE
)
unset(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX CACHE)
columnstore_add_rpm_deps("snappy" "jemalloc" "procps-ng" "gawk")

# Ensure our overrides are applied by CPack at packaging time CPACK_PROJECT_CONFIG_FILE is included by cpack after
# CPackConfig.cmake is loaded
set(CPACK_PROJECT_CONFIG_FILE
"${CMAKE_CURRENT_LIST_DIR}/cpack_overrides.cmake"
CACHE FILEPATH "Columnstore CPack overrides" FORCE
)
if(COLUMNSTORE_MAINTAINER)
# Columnstore-specific RPM packaging overrides 1) Use fast compression to speed up packaging
set(CPACK_RPM_COMPRESSION_TYPE
"zstd"
CACHE STRING "RPM payload compression" FORCE
)
# 2) Disable debuginfo/debugsource to avoid slow packaging and duplicate file warnings
set(CPACK_RPM_DEBUGINFO_PACKAGE
OFF
CACHE BOOL "Disable debuginfo package" FORCE
)
set(CPACK_RPM_PACKAGE_DEBUG
0
CACHE STRING "Disable RPM debug package" FORCE
)
unset(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX CACHE)

columnstore_add_rpm_deps("snappy" "jemalloc" "procps-ng" "gawk")
# Ensure our overrides are applied by CPack at packaging time CPACK_PROJECT_CONFIG_FILE is included by cpack after
# CPackConfig.cmake is loaded
set(CPACK_PROJECT_CONFIG_FILE
"${CMAKE_CURRENT_LIST_DIR}/cpack_overrides.cmake"
CACHE FILEPATH "Columnstore CPack overrides" FORCE
)
endif() # COLUMNSTORE_MAINTAINER
12 changes: 12 additions & 0 deletions dbcon/execplan/calpontselectexecutionplan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,11 @@ void CalpontSelectExecutionPlan::serialize(messageqcpp::ByteStream& b) const
b << timeZone;
b << fPron;
b << (uint8_t)fWithRollup;
b << (uint8_t)fIsRecursiveWithTable;
b << (uint8_t)fIsRecursiveQuery;
b << (uint8_t)fContainsRecursiveQuery;

b << fMaxRecursiveDepth;
}

void CalpontSelectExecutionPlan::unserialize(messageqcpp::ByteStream& b)
Expand Down Expand Up @@ -832,6 +837,13 @@ void CalpontSelectExecutionPlan::unserialize(messageqcpp::ByteStream& b)
utils::Pron::instance().pron(fPron);
b >> tmp8;
fWithRollup = tmp8;
b >> tmp8;
fIsRecursiveWithTable = tmp8;
b >> tmp8;
fIsRecursiveQuery = tmp8;
b >> tmp8;
fContainsRecursiveQuery = tmp8;
b >> fMaxRecursiveDepth;
}

bool CalpontSelectExecutionPlan::operator==(const CalpontSelectExecutionPlan& t) const
Expand Down
55 changes: 54 additions & 1 deletion dbcon/execplan/calpontselectexecutionplan.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/** @file */

#pragma once
#include <cstdint>
#include <vector>
#include <map>
#include <iosfwd>
Expand Down Expand Up @@ -496,7 +497,12 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{
return fDerivedTableList;
}
void derivedTableList(const SelectList& derivedTableList)

SelectList& derivedTableList()
{
return fDerivedTableList;
}
void derivedTableList(SelectList& derivedTableList)
{
fDerivedTableList = derivedTableList;
}
Expand All @@ -523,10 +529,12 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{
fUnionVec = unionVec;
}

const SelectList& unionVec() const
{
return fUnionVec;
}

SelectList& unionVec()
{
return fUnionVec;
Expand Down Expand Up @@ -765,6 +773,46 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
return fTimeZone;
}

void isRecursiveWithTable(bool b)
{
fIsRecursiveWithTable = b;
}

bool isRecursiveWithTable()
{
return fIsRecursiveWithTable;
}

void isRecursiveQuery(bool b)
{
fIsRecursiveQuery = b;
}

bool isRecursiveQuery()
{
return fIsRecursiveQuery;
}

void containsRecursiveQuery(bool b)
{
fContainsRecursiveQuery = b;
}

bool containsRecursiveQuery()
{
return fContainsRecursiveQuery;
}

void maxRecursiveDepth(uint32_t i)
{
fMaxRecursiveDepth = i;
}

int maxRecursiveDepth()
{
return fMaxRecursiveDepth;
}

/**
* The serialization interface
*/
Expand Down Expand Up @@ -985,6 +1033,11 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
* A flag to compute subtotals, related to GROUP BY operation.
*/
bool fWithRollup;
bool fIsRecursiveWithTable = false;
bool fIsRecursiveQuery = false;
bool fContainsRecursiveQuery = false;

uint32_t fMaxRecursiveDepth;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion dbcon/joblist/fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class FIFO : public DataListImpl<std::vector<element_t>, element_t>
}

inline void dropToken() {};
inline void dropToken(uint32_t){};
inline void dropToken(uint32_t) {};

// Counters that reflect how many many times this FIFO blocked on reads/writes
uint64_t blockedWriteCount() const;
Expand Down
10 changes: 9 additions & 1 deletion dbcon/joblist/jlf_subquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <iostream>
#include <stack>
#include <iterator>
//#define NDEBUG
// #define NDEBUG
#include <cassert>
#include <vector>
using namespace std;
Expand Down Expand Up @@ -748,6 +748,10 @@ int doFromSubquery(CalpontExecutionPlan* ep, const string& alias, const string&
SJSTEP subQueryStep = transformer.makeSubQueryStep(csep, true);
subQueryStep->view(view);
SJSTEP subAd(new SubAdapterStep(subQueryStep, jobInfo));
if (csep->isRecursiveQuery())
{
dynamic_cast<SubAdapterStep*>(subAd.get())->isRecursiveStep(true);
}
jobInfo.selectAndFromSubs.push_back(subAd);

return CNX_VTABLE_ID;
Expand Down Expand Up @@ -870,6 +874,10 @@ SJSTEP doUnionSub(CalpontExecutionPlan* ep, JobInfo& jobInfo)
transformer.setVarbinaryOK();
SJSTEP subQueryStep = transformer.makeSubQueryStep(csep, false);
SJSTEP subAd(new SubAdapterStep(subQueryStep, jobInfo));
if (csep->isRecursiveQuery())
{
dynamic_cast<SubAdapterStep*>(subAd.get())->isRecursiveStep(true);
}
return subAd;
}

Expand Down
Loading