Skip to content

Commit b15f0ac

Browse files
committed
Merge 'master' into ncb/startupscript-warning-msg
2 parents 5533156 + 60579e2 commit b15f0ac

File tree

204 files changed

+2057
-713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

204 files changed

+2057
-713
lines changed

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,6 @@ option(OMIT_HEAVY_DEBUG_SYMBOLS
204204
${OMIT_HEAVY_DEBUG_SYMBOLS_DEFAULT})
205205

206206
option(BUILD_STANDALONE_KEEPER "Build keeper as small standalone binary" OFF)
207-
if (NOT BUILD_STANDALONE_KEEPER)
208-
option(CREATE_KEEPER_SYMLINK "Create symlink for clickhouse-keeper to main server binary" ON)
209-
else ()
210-
option(CREATE_KEEPER_SYMLINK "Create symlink for clickhouse-keeper to main server binary" OFF)
211-
endif ()
212207

213208
# Create BuildID when using lld. For other linkers it is created by default.
214209
# (NOTE: LINKER_NAME can be either path or name, and in different variants)

ci/jobs/scripts/functional_tests/setup_ch_cluster.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ else
110110
fi
111111
clickhouse-client --query "CREATE TABLE test.hits_s3 (WatchID UInt64, JavaEnable UInt8, Title String, GoodEvent Int16, EventTime DateTime, EventDate Date, CounterID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RegionID UInt32, UserID UInt64, CounterClass Int8, OS UInt8, UserAgent UInt8, URL String, Referer String, URLDomain String, RefererDomain String, Refresh UInt8, IsRobot UInt8, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), ResolutionWidth UInt16, ResolutionHeight UInt16, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, FlashMinor2 String, NetMajor UInt8, NetMinor UInt8, UserAgentMajor UInt16, UserAgentMinor FixedString(2), CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, MobilePhone UInt8, MobilePhoneModel String, Params String, IPNetworkID UInt32, TraficSourceID Int8, SearchEngineID UInt16, SearchPhrase String, AdvEngineID UInt8, IsArtifical UInt8, WindowClientWidth UInt16, WindowClientHeight UInt16, ClientTimeZone Int16, ClientEventTime DateTime, SilverlightVersion1 UInt8, SilverlightVersion2 UInt8, SilverlightVersion3 UInt32, SilverlightVersion4 UInt16, PageCharset String, CodeVersion UInt32, IsLink UInt8, IsDownload UInt8, IsNotBounce UInt8, FUniqID UInt64, HID UInt32, IsOldCounter UInt8, IsEvent UInt8, IsParameter UInt8, DontCountHits UInt8, WithHash UInt8, HitColor FixedString(1), UTCEventTime DateTime, Age UInt8, Sex UInt8, Income UInt8, Interests UInt16, Robotness UInt8, GeneralInterests Array(UInt16), RemoteIP UInt32, RemoteIP6 FixedString(16), WindowName Int32, OpenerName Int32, HistoryLength Int16, BrowserLanguage FixedString(2), BrowserCountry FixedString(2), SocialNetwork String, SocialAction String, HTTPError UInt16, SendTiming Int32, DNSTiming Int32, ConnectTiming Int32, ResponseStartTiming Int32, ResponseEndTiming Int32, FetchTiming Int32, RedirectTiming Int32, DOMInteractiveTiming Int32, DOMContentLoadedTiming Int32, DOMCompleteTiming Int32, LoadEventStartTiming Int32, LoadEventEndTiming Int32, NSToDOMContentLoadedTiming Int32, FirstPaintTiming Int32, RedirectCount Int8, SocialSourceNetworkID UInt8, SocialSourcePage String, ParamPrice Int64, ParamOrderID String, ParamCurrency FixedString(3), ParamCurrencyID UInt16, GoalsReached Array(UInt32), OpenstatServiceName String, OpenstatCampaignID String, OpenstatAdID String, OpenstatSourceID String, UTMSource String, UTMMedium String, UTMCampaign String, UTMContent String, UTMTerm String, FromTag String, HasGCLID UInt8, RefererHash UInt64, URLHash UInt64, CLID UInt32, YCLID UInt64, ShareService String, ShareURL String, ShareTitle String, ParsedParams Nested(Key1 String, Key2 String, Key3 String, Key4 String, Key5 String, ValueDouble Float64), IslandID FixedString(16), RequestNum UInt32, RequestTry UInt8) ENGINE = MergeTree() PARTITION BY toYYYYMM(EventDate) ORDER BY (CounterID, EventDate, intHash32(UserID)) SAMPLE BY intHash32(UserID) SETTINGS index_granularity = 8192, storage_policy='s3_cache'"
112112
# AWS S3 is very inefficient, so increase memory even further:
113-
clickhouse-client --max_memory_usage 30G --max_memory_usage_for_user 30G --query "INSERT INTO test.hits_s3 SELECT * FROM test.hits SETTINGS enable_filesystem_cache_on_write_operations=0, max_insert_threads=16"
113+
clickhouse-client --max_execution_time 600 --max_memory_usage 30G --max_memory_usage_for_user 30G --query "INSERT INTO test.hits_s3 SELECT * FROM test.hits SETTINGS enable_filesystem_cache_on_write_operations=0, max_insert_threads=16"
114114
fi
115115

116116
clickhouse-client --query "SHOW TABLES FROM test"

docker/test/integration/runner/Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,17 @@ RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \
6363
COPY requirements.txt /
6464
RUN python3 -m pip install --no-cache-dir -r requirements.txt
6565

66-
# Hudi supports only spark 3.3.*, not 3.4
67-
RUN curl -fsSL -O https://archive.apache.org/dist/spark/spark-3.3.2/spark-3.3.2-bin-hadoop3.tgz \
68-
&& tar xzvf spark-3.3.2-bin-hadoop3.tgz -C / \
69-
&& rm spark-3.3.2-bin-hadoop3.tgz
66+
RUN curl -fsSL -O https://archive.apache.org/dist/spark/spark-3.5.5/spark-3.5.5-bin-hadoop3.tgz \
67+
&& tar xzvf spark-3.5.5-bin-hadoop3.tgz -C / \
68+
&& rm spark-3.5.5-bin-hadoop3.tgz
7069

7170
# download spark and packages
7271
# if you change packages, don't forget to update them in tests/integration/helpers/cluster.py
73-
RUN packages="org.apache.hudi:hudi-spark3.3-bundle_2.12:0.13.0,\
74-
io.delta:delta-core_2.12:2.3.0,\
75-
org.apache.iceberg:iceberg-spark-runtime-3.3_2.12:1.1.0" \
76-
&& /spark-3.3.2-bin-hadoop3/bin/spark-shell --packages "$packages" > /dev/null \
77-
&& find /root/.ivy2/ -name '*.jar' -exec ln -sf {} /spark-3.3.2-bin-hadoop3/jars/ \;
72+
RUN packages="io.delta:delta-spark_2.12:3.1.0,\
73+
org.apache.hudi:hudi-spark3.5-bundle_2.12:1.0.1,\
74+
org.apache.iceberg:iceberg-spark-runtime-3.5_2.12:1.4.3" \
75+
&& /spark-3.5.5-bin-hadoop3/bin/spark-shell --packages "$packages" > /dev/null \
76+
&& find /root/.ivy2/ -name '*.jar' -exec ln -sf {} /spark-3.5.5-bin-hadoop3/jars/ \;
7877

7978
RUN set -x \
8079
&& addgroup --system dockremap \

docker/test/integration/runner/dockerd-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ set -e
5454

5555
java_path="$(update-alternatives --config java | sed -n 's/.*(providing \/usr\/bin\/java): //p')"
5656
export JAVA_PATH=$java_path
57-
export SPARK_HOME="/spark-3.3.2-bin-hadoop3"
57+
export SPARK_HOME="/spark-3.5.5-bin-hadoop3"
5858
export PATH=$SPARK_HOME/bin:$PATH
5959
export JAVA_TOOL_OPTIONS="-Djdk.attach.allowAttachSelf=true"
6060

docker/test/integration/runner/requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ cramjam==2.9.1
2828
cryptography==42.0.0
2929
datacompy==0.7.3
3030
decorator==5.1.1
31-
delta-spark==2.3.0
32-
deltalake==0.16.0
31+
delta-spark==3.3.0
32+
deltalake==0.25.5
3333
dict2xml==1.7.4
3434
dicttoxml==1.7.16
3535
docker==6.1.3
@@ -68,7 +68,7 @@ protobuf==4.25.2
6868
psycopg-binary==3.2.4
6969
psycopg2-binary==2.9.6
7070
psycopg==3.2.4
71-
py4j==0.10.9.5
71+
py4j==0.10.9.7
7272
pyarrow-hotfix==0.6
7373
pyarrow==17.0.0
7474
pycparser==2.22
@@ -79,7 +79,7 @@ pyiceberg==0.8.1
7979
pyiceberg[glue]==0.8.1
8080
pymongo==3.11.0
8181
pyparsing==3.1.0
82-
pyspark==3.3.2
82+
pyspark==3.5.5
8383
pyspnego==0.10.2
8484
pytest-order==1.0.0
8585
pytest-random-order==1.1.1

docs/en/sql-reference/data-types/date.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: 'Documentation for the Date data type in ClickHouse'
33
sidebar_label: 'Date'
4-
sidebar_position: 34
4+
sidebar_position: 12
55
slug: /sql-reference/data-types/date
66
title: 'Date'
77
---

docs/en/sql-reference/data-types/date32.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ SELECT * FROM dt32;
3838
┌──timestamp─┬─event_id─┐
3939
│ 2100-01-01 │ 1 │
4040
│ 2100-01-01 │ 2 │
41+
│ 2100-01-01 │ 3 │
4142
└────────────┴──────────┘
4243
```
4344

programs/CMakeLists.txt

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,13 @@ clickhouse_target_link_split_lib(clickhouse install)
155155
set (CLICKHOUSE_BUNDLE)
156156
macro(clickhouse_program_install name lib_name)
157157
clickhouse_target_link_split_lib(clickhouse ${lib_name})
158-
add_custom_target (${name} ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse ${name} DEPENDS clickhouse)
158+
add_custom_command (TARGET clickhouse POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse ${name})
159159
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
160-
list(APPEND CLICKHOUSE_BUNDLE ${name})
161160

162161
foreach(alias ${ARGN})
163162
message(STATUS "Adding alias ${alias} for ${name}")
164-
add_custom_target (${alias} ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse ${alias} DEPENDS clickhouse)
163+
add_custom_command (TARGET clickhouse POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse ${alias})
165164
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${alias}" DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
166-
list(APPEND CLICKHOUSE_BUNDLE ${alias})
167165
endforeach()
168166
endmacro()
169167

@@ -197,32 +195,25 @@ if (TARGET ch_contrib::rapidjson AND TARGET ch_contrib::nuraft)
197195
endif ()
198196

199197
if (ENABLE_CLICKHOUSE_KEEPER)
200-
if (NOT BUILD_STANDALONE_KEEPER AND CREATE_KEEPER_SYMLINK)
201-
add_custom_target (clickhouse-keeper ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-keeper DEPENDS clickhouse)
198+
if (NOT BUILD_STANDALONE_KEEPER)
199+
add_custom_command (TARGET clickhouse POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-keeper)
202200
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/clickhouse-keeper" DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
203201
endif()
204202

205203
# otherwise we don't build keeper
206-
if (BUILD_STANDALONE_KEEPER OR CREATE_KEEPER_SYMLINK)
204+
if (BUILD_STANDALONE_KEEPER)
207205
list(APPEND CLICKHOUSE_BUNDLE clickhouse-keeper)
208206
endif()
209207
endif ()
210208
if (ENABLE_CLICKHOUSE_KEEPER_CONVERTER)
211-
add_custom_target (clickhouse-keeper-converter ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-keeper-converter DEPENDS clickhouse)
209+
add_custom_command (TARGET clickhouse POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-keeper-converter)
212210
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/clickhouse-keeper-converter" DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
213-
list(APPEND CLICKHOUSE_BUNDLE clickhouse-keeper-converter)
214211
endif ()
215212
if (ENABLE_CLICKHOUSE_KEEPER_CLIENT)
216213
if (NOT BUILD_STANDALONE_KEEPER)
217-
add_custom_target (clickhouse-keeper-client ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-keeper-client DEPENDS clickhouse)
214+
add_custom_command (TARGET clickhouse POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse clickhouse-keeper-client)
218215
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/clickhouse-keeper-client" DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
219-
# symlink to standalone keeper binary
220-
else ()
221-
add_custom_target (clickhouse-keeper-client ALL COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse-keeper clickhouse-keeper-client DEPENDS clickhouse-keeper)
222-
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/clickhouse-keeper-client" DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT clickhouse-keeper)
223216
endif ()
224-
225-
list(APPEND CLICKHOUSE_BUNDLE clickhouse-keeper-client)
226217
endif ()
227218

228219
add_custom_target (clickhouse-bundle ALL DEPENDS ${CLICKHOUSE_BUNDLE})

programs/keeper/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,9 @@ if (BUILD_STANDALONE_KEEPER)
3333
clickhouse_make_empty_debug_info_for_nfpm(TARGET clickhouse-keeper DESTINATION_DIR ${CMAKE_CURRENT_BINARY_DIR}/../${SPLIT_DEBUG_SYMBOLS_DIR})
3434
install(TARGETS clickhouse-keeper RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT clickhouse)
3535
endif()
36+
37+
if (ENABLE_CLICKHOUSE_KEEPER_CLIENT)
38+
add_custom_command (TARGET clickhouse-keeper POST_BUILD COMMAND ${CMAKE_COMMAND} -E create_symlink clickhouse-keeper clickhouse-keeper-client)
39+
install (FILES "${CMAKE_CURRENT_BINARY_DIR}/clickhouse-keeper-client" DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT clickhouse-keeper)
40+
endif()
3641
endif()

programs/local/LocalServer.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,10 +915,14 @@ void LocalServer::processConfig()
915915

916916
if (getClientConfiguration().has("path"))
917917
{
918-
attachSystemTablesServer(global_context, *createMemoryDatabaseIfNotExists(global_context, DatabaseCatalog::SYSTEM_DATABASE), false);
919918
attachInformationSchema(global_context, *createMemoryDatabaseIfNotExists(global_context, DatabaseCatalog::INFORMATION_SCHEMA));
920919
attachInformationSchema(global_context, *createMemoryDatabaseIfNotExists(global_context, DatabaseCatalog::INFORMATION_SCHEMA_UPPERCASE));
921920

921+
/// Attaching "automatic" tables in the system database is done after attaching the system database.
922+
/// Consequently, it depends on whether we load it from the path.
923+
/// If it is loaded from a user-specified path, we load it as usual. If not, we create it as a memory (ephemeral) database.
924+
bool attached_system_database = false;
925+
922926
String path = global_context->getPath();
923927

924928
/// Lock path directory before read
@@ -933,6 +937,9 @@ void LocalServer::processConfig()
933937
{
934938
LoadTaskPtrs load_system_metadata_tasks = loadMetadataSystem(global_context);
935939
waitLoad(TablesLoaderForegroundPoolId, load_system_metadata_tasks);
940+
941+
attachSystemTablesServer(global_context, *DatabaseCatalog::instance().tryGetDatabase(DatabaseCatalog::SYSTEM_DATABASE), false);
942+
attached_system_database = true;
936943
}
937944

938945
if (!getClientConfiguration().has("only-system-tables"))
@@ -947,6 +954,9 @@ void LocalServer::processConfig()
947954

948955
LOG_DEBUG(log, "Loaded metadata.");
949956
}
957+
958+
if (!attached_system_database)
959+
attachSystemTablesServer(global_context, *createMemoryDatabaseIfNotExists(global_context, DatabaseCatalog::SYSTEM_DATABASE), false);
950960
}
951961
else if (!getClientConfiguration().has("no-system-tables"))
952962
{

0 commit comments

Comments
 (0)