Skip to content

Commit

Permalink
Kusto-phase3: rebase v23.8.2.7-lts
Browse files Browse the repository at this point in the history
  • Loading branch information
kashwy committed Sep 19, 2023
1 parent 447638d commit 61e14cd
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 26 deletions.
8 changes: 4 additions & 4 deletions programs/keeper/Keeper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ int mainEntryClickHouseKeeper(int argc, char ** argv)

// // Weak symbols don't work correctly on Darwin
// // so we have a stub implementation to avoid linker errors
// void collectCrashLog(
// Int32, UInt64, const String &, const StackTrace &)
// {}
void collectCrashLog(
Int32, UInt64, const String &, const StackTrace &)
{}

// #endif
#endif

namespace DB
{
Expand Down
11 changes: 1 addition & 10 deletions programs/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2087,16 +2087,7 @@ void Server::createServers(

for (const auto & protocol : protocols)
{
std::string prefix = "protocols." + protocol + ".";
std::string port_name = prefix + "port";
std::string description {"<undefined> protocol"};
if (config.has(prefix + "description"))
description = config.getString(prefix + "description");

if (!config.has(prefix + "port"))
continue;

if (!server_type.shouldStart(ServerType::Type::CUSTOM, port_name))
if (!server_type.shouldStart(ServerType::Type::CUSTOM, protocol))
continue;

std::string prefix = "protocols." + protocol + ".";
Expand Down
5 changes: 1 addition & 4 deletions src/Functions/FunctionBinaryArithmetic.h
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,6 @@ class FunctionBinaryArithmetic : public IFunction
{
static constexpr bool is_plus = IsOperation<Op>::plus;
static constexpr bool is_minus = IsOperation<Op>::minus;
static constexpr bool is_modulo = IsOperation<Op>::modulo;
static constexpr bool is_modulo_or_zero = IsOperation<Op>::modulo_or_zero;
static constexpr bool is_multiply = IsOperation<Op>::multiply;
static constexpr bool is_division = IsOperation<Op>::division;
Expand Down Expand Up @@ -1471,9 +1470,7 @@ class FunctionBinaryArithmetic : public IFunction
}
}


/// Special case when the function is plus or minus, one of arguments is Date/DateTime and another is Interval.
if (auto function_builder = getFunctionForIntervalArithmetic(arguments[0], arguments[1], context))
if (auto function_builder = getFunctionForDateTimeArithmetic(arguments[0], arguments[1], context))
{
ColumnsWithTypeAndName new_arguments(2);
for (size_t i = 0; i < 2; ++i)
Expand Down
2 changes: 1 addition & 1 deletion src/Functions/Kusto/kqlHasAnyIp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <Functions/Kusto/KqlFunctionBase.h>
#include <boost/spirit/home/x3.hpp>
#include <format>

#include <numeric>
namespace DB
{
namespace ErrorCodes
Expand Down
1 change: 1 addition & 0 deletions src/Server/ServerType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ bool ServerType::shouldStart(Type server_type, const std::string & server_custom
bool ServerType::shouldStop(const std::string & port_name) const
{
Type port_type;
std::string port_custom_name;

if (port_name == "http_port")
port_type = Type::HTTP;
Expand Down
4 changes: 2 additions & 2 deletions src/TableFunctions/TableFunctionGetSchema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ErrorCodes
extern const int LOGICAL_ERROR;
}

ColumnsDescription TableFunctionGetSchema::getActualTableStructure(ContextPtr) const
ColumnsDescription TableFunctionGetSchema::getActualTableStructure(ContextPtr, bool /*is_insert_query*/) const
{
return ColumnsDescription{StorageSystemSchema::getNamesAndTypes()};
}
Expand All @@ -24,7 +24,7 @@ void TableFunctionGetSchema::parseArguments(const ASTPtr &, ContextPtr)
}

StoragePtr
TableFunctionGetSchema::executeImpl(const ASTPtr & ast_function, ContextPtr, const std::string & table_name, ColumnsDescription) const
TableFunctionGetSchema::executeImpl(const ASTPtr & ast_function, ContextPtr, const std::string & table_name, ColumnsDescription, bool /*is_insert_query*/) const
{
const auto * function = ast_function->as<ASTFunction>();
if (!function)
Expand Down
4 changes: 2 additions & 2 deletions src/TableFunctions/TableFunctionGetSchema.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TableFunctionGetSchema : public ITableFunction

~TableFunctionGetSchema() override = default;

ColumnsDescription getActualTableStructure(ContextPtr context) const override;
ColumnsDescription getActualTableStructure(ContextPtr context, bool is_insert_query) const override;
std::string getName() const override { return name; }
bool hasStaticStructure() const override { return true; }

Expand All @@ -21,7 +21,7 @@ class TableFunctionGetSchema : public ITableFunction
const char * getStorageTypeName() const override { return "GetSchema"; }

StoragePtr executeImpl(
const ASTPtr & ast_function, ContextPtr context, const std::string & table_name, ColumnsDescription cached_columns) const override;
const ASTPtr & ast_function, ContextPtr context, const std::string & table_name, ColumnsDescription cached_columns, bool is_insert_query) const override;
};

class TableFunctionFactory;
Expand Down
6 changes: 3 additions & 3 deletions tests/queries/0_stateless/02366_kql_summarize.sql
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ print '-- variance/variancep/varianceif --';
Customers | summarize variance(Age);
Customers | summarize variancep(Age);
Customers | summarize varianceif(Age, Age < 30);
Customers | summarize variance(null); -- { clientError Code: 395 }
Customers | summarize variancep(null); -- { clientError Code: 395 }
Customers | summarize varianceif(null, Age < 30); -- { clientError Code: 395 }
Customers | summarize variance(null); -- { serverError 395 }
Customers | summarize variancep(null); -- { serverError 395 }
Customers | summarize varianceif(null, Age < 30); -- { serverError 395 }

print '-- arg_max --';
Customers | summarize arg_max(Age); -- { clientError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
Expand Down

0 comments on commit 61e14cd

Please sign in to comment.