Anton Popov
e96af9fd75
better binary serialization of ColumnObject
2022-05-24 13:16:11 +00:00
avogar
f69c3175af
Fix comments
2022-05-19 10:13:44 +00:00
avogar
cb8646fbb4
Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-array-map-nothing
2022-05-19 07:18:48 +00:00
avogar
415aabd4d0
Fix Nullable(String) to Nullable(Bool/IPv4/IPv6) conversion
2022-05-16 19:15:18 +00:00
avogar
0311dbb422
Add default implementation for Nothing, support arrays of nullable for arrayFilter and similar functions
2022-05-12 15:15:31 +00:00
Anton Popov
515f68eead
Merge remote-tracking branch 'upstream/master' into dynamic-columns-14
2022-05-06 16:10:51 +00:00
Anton Popov
566c08086a
support Object type inside other types
2022-05-06 14:44:00 +00:00
Yakov Olkhovskiy
9c1a06703a
Merge pull request #36564 from awakeljw/fork_chmaster2
...
Fix CAST Object to Object with Nullable subcolumns
2022-05-04 14:40:43 -04:00
awakeljw
0a32fe4da3
Fix CAST Object to Object with Nullable subcolumns
2022-05-02 11:31:13 +08:00
Azat Khuzhin
767acd53fb
Add ability to pass range of rows to Aggregator
...
v2: fix compiled aggregate functions (seek result to row_start)
v3: fix compiled aggregate functions (seek args to row_start)
v4: change signatures for JIT
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-04-29 06:57:55 +03:00
Vladimir C
2ebae2d722
Merge pull request #35682 from CurtizJ/dynamic-columns-6
2022-04-06 11:48:07 +02:00
avogar
af4bfec051
Fix bug in conversion from custom types to string
2022-03-30 11:19:03 +00:00
Anton Popov
6cbdc6af00
remove obsolete parameter
2022-03-28 18:44:53 +00:00
Anton Popov
67195bfdd5
support schema inference for type Object in format JSONEachRow
2022-03-25 21:51:53 +00:00
Maksim Kita
4b88c6f934
Merge pull request #35534 from kitaisreal/set-in-ipv4-ipv6-address-cast-fix
...
Fix cast into IPv4, IPv6 address in IN section
2022-03-24 01:26:25 +01:00
Maksim Kita
31b3d2e840
Fixed tests
2022-03-23 19:59:26 +01:00
Maksim Kita
ff2d5dae83
Fix cast into IPv4, IPv6 address in IN section
2022-03-23 15:22:08 +01:00
mergify[bot]
e11ef05c2b
Merge branch 'master' into issue_33147
2022-03-21 13:40:17 +00:00
Robert Schulze
df73c75456
Replace more uses of std::enable_if for SFINAE by concepts
...
- enable_if is usually regarded as fragile and unreadable
- C++20 concepts are much easier to read and produce more expressive error messages
- this is follow-up to PR #35347 but this time most of the remaining and
more complex usages of enable_if in the codebase were replaced.
2022-03-17 20:44:55 +01:00
alesapin
457fa0d1ba
Merge pull request #23932 from CurtizJ/dynamic-columns
...
Support of dynamic subcolumns (JSON data type)
2022-03-17 10:45:46 +01:00
Maksim Kita
f837f609f3
Merge pull request #35240 from kitaisreal/cast-to-ip-address-refactoring
...
Standardize behaviour of CAST into IPv4, IPv6, toIPv4, toIPv6 functions
2022-03-17 10:26:32 +01:00
Anton Popov
0ba78c3c3a
Merge remote-tracking branch 'upstream/master' into HEAD
2022-03-16 15:28:09 +00:00
Maksim Kita
538f8cbaad
Fix clang-tidy warnings in Disks, Formats, Functions folders
2022-03-14 18:17:35 +00:00
Maksim Kita
36dc7f03a4
Fixed tests
2022-03-14 09:14:41 +00:00
Maksim Kita
3a2b3ce503
Standardize behaviour of CAST into IPv4, IPv6, toIPv4, toIPv6 functions
2022-03-12 17:12:05 +00:00
Anton Popov
df3b07fe7c
Merge remote-tracking branch 'upstream/master' into HEAD
2022-03-03 22:25:28 +00:00
HaiBo Li
2ea18b3085
Fix the bug that the toDatetime function overflows ( #32898 )
...
* Fixed overflow bug of the function toDatetime/toDate/toDate32/parseDateTimeBestEffort
2022-03-02 10:06:38 +03:00
Anton Popov
2758db5341
add more comments
2022-03-01 19:32:55 +03:00
zvonand
9456d89fad
Move current work from old laptop
...
skip-checks: true
2022-02-07 21:44:14 +03:00
Anton Popov
aab6ef60b2
better performance of parsing json data
2022-02-01 14:17:29 +03:00
Anton Popov
78b9f15abb
Merge remote-tracking branch 'upstream/master' into HEAD
2022-01-30 03:24:37 +03:00
Maksim Kita
24267c8cfb
Fixed tests
2022-01-27 16:02:31 +00:00
Maksim Kita
af5ad2f370
Remove DecimalPaddedPODArray
2022-01-27 10:07:53 +00:00
Anton Popov
90b74c2aeb
better unflattenTuple
2022-01-27 03:24:34 +03:00
Kruglov Pavel
ed43abbaeb
Update FunctionsConversion.h
2022-01-25 12:32:21 +03:00
avogar
ad01d68f36
Fix parsing IPv6 from query parameter and fix IPv6 to string conversion
2022-01-25 10:09:17 +03:00
Maksim Kita
333bd24aca
Fixed tests
2022-01-23 00:09:29 +00:00
Maksim Kita
4be393fba5
Support cast from Map to Array of Tuple
2022-01-22 20:40:18 +00:00
Anton Popov
e8ce091e68
Merge remote-tracking branch 'upstream/master' into HEAD
2022-01-21 20:11:18 +03:00
avogar
ba54a5ff80
Some improvements and fixes for Bool data type
2022-01-20 14:16:11 +03:00
vdimir
154e7b03c0
Disable FunctionConvertFromString::canBeExecutedOnDefaultArguments
2021-12-29 13:34:54 +03:00
avogar
85d214d560
Fix build
2021-12-23 20:14:54 +03:00
avogar
2e02a6bcca
Try to fix build
2021-12-23 19:47:29 +03:00
avogar
ce68c54b03
Fix comments, reduce extra copying
2021-12-23 19:47:29 +03:00
avogar
5e5d6609ed
Proper cast to bool
2021-12-23 19:47:29 +03:00
avogar
19faf46b68
Improve Bool data type
2021-12-23 19:47:29 +03:00
Anton Popov
63fceca6a8
support nested in json type (wip)
2021-12-01 05:59:56 +03:00
Anton Popov
a20922b2d3
Merge remote-tracking branch 'origin/sparse-serialization' into HEAD
2021-11-09 15:36:25 +03:00
mergify[bot]
4f6fd49266
Merge branch 'master' into fix_IP_conversion
2021-11-09 12:11:54 +00:00
lhuang0928
008a13df8b
fix date32 comparison with datetime/datetime64
2021-10-20 03:36:07 +00:00
mergify[bot]
5b667d3cd5
Merge branch 'master' into fix_IP_conversion
2021-10-06 16:40:47 +00:00
Nikolay Degterinsky
345ac59f46
Merge pull request #29552 from MaxWk/conversion-between-date32-and-datetime64
...
Support conversion between date32 and datetime64
2021-10-04 12:43:56 +03:00
alexey-milovidov
ac57e057a1
Merge pull request #23028 from ClickHouse/cast_to_value_or_default
...
Merging #21330
2021-10-03 11:00:48 +03:00
Maksim Kita
c2407fee06
Fixed tests
2021-09-30 14:35:24 +03:00
MaxWk
3cbabe2c68
support conversion between date32 and datetime64
2021-09-30 15:09:36 +08:00
Dmitry Novik
abdd8fb516
Cleanup
2021-09-29 19:42:41 +03:00
Mike Kot
61e0c6208b
Making Monotonicity an aggregate to use with designated initializers
2021-09-29 18:01:26 +02:00
Dmitry Novik
9049fd701f
Refactor ColumnStringHelpers
2021-09-21 17:27:34 +03:00
Vasily Nemkov
175b94fa2d
Special case of conversion code for types with custom serialization/deserialization
...
Fixes CASTing from String or FixedString to IPv4 or IPv6 and back.
2021-09-21 15:34:06 +03:00
Mike Kot
bce011cb33
Replacing IsDecimalNumber
2021-09-11 00:40:18 +02:00
Mike Kot
c4385a2c40
Simplifying exception messages
2021-09-11 00:40:18 +02:00
Anton Popov
b05943f4a4
add text serialization for type Object
2021-08-21 03:31:44 +03:00
Anton Popov
61239343e3
Merge remote-tracking branch 'origin/sparse-serialization' into HEAD
2021-08-20 16:33:30 +03:00
alexey-milovidov
eb3bbdfab5
Merge pull request #27680 from ClickHouse/decimal-no-trailing-zeros
...
Remove trailing zeros from Decimal serialization #15794
2021-08-18 05:24:13 +03:00
Pavel Kruglov
7c98fc11b9
Fix performance, make only one setting
2021-08-16 14:30:56 +03:00
Alexey Milovidov
8adaef7c8e
Make text format for Decimal tuneable
2021-08-16 11:03:23 +03:00
mergify[bot]
319e5af6eb
Merge branch 'master' into short-circuit
2021-08-13 13:01:46 +00:00
kssenii
dcc6f597dc
Move templates from FunctionsConvertion
2021-08-11 19:09:51 +00:00
kssenii
7555fc19fd
Revert "Move some templates"
...
This reverts commit 7f247becca
.
2021-08-11 18:49:25 +00:00
kssenii
7f247becca
Move some templates
2021-08-11 07:32:46 +00:00
Anton Popov
5a2daae63a
add conversion from tuple to object
2021-08-10 04:33:57 +03:00
Pavel Kruglov
1fa8901cdb
Mark functions conversion as suitable for short-circuit
2021-08-09 18:02:09 +03:00
Pavel Kruglov
70b51133c1
Try to simplify code
2021-08-09 18:01:08 +03:00
Pavel Kruglov
bff79d7774
Fix special build
2021-08-09 17:57:50 +03:00
Pavel Kruglov
a95d45a157
Some clean up
2021-08-09 17:57:02 +03:00
Pavel Kruglov
3ec2ab6156
Avoid using expand, fix bugs, add tests and comments
2021-08-09 17:54:49 +03:00
Pavel Kruglov
0662df8b76
Fix performance with JIT, add arguments to function isSuitableForShortCircuitArgumentsExecution
2021-08-09 17:54:14 +03:00
Pavel Kruglov
e792fa588f
Mark all Functions as sutable or not for executing as short circuit arguments
2021-08-09 17:50:09 +03:00
kssenii
01b4bd3f91
Fix some more tests
2021-08-07 14:28:12 +00:00
kssenii
ec9e82fb0c
Fix some tests
2021-08-07 10:12:59 +00:00
kssenii
9ca422f0c5
Introduce CAST for internal usage
2021-08-07 09:03:10 +00:00
Anton Popov
f99374cca6
Merge remote-tracking branch 'origin/sparse-serialization' into HEAD
2021-07-20 18:20:21 +03:00
kssenii
9cb10aae3c
Some fixes
2021-07-18 03:43:08 +00:00
kssenii
3ba2d114d5
Revert "Merge pull request #26352 from ClickHouse/revert-25774-datatype-date32"
...
This reverts commit 94a210650f
, reversing
changes made to 0893b9ff8e
.
2021-07-15 11:41:52 +00:00
alexey-milovidov
9ba4064c86
Revert "Datatype Date32, support range 1925 to 2283"
2021-07-15 10:53:35 +03:00
Vladimir
c6177bd0cc
Merge pull request #26123 from vdimir/issue-25806-null-enum-to-str
2021-07-14 10:22:37 +03:00
vdimir
a01f8c147d
Move check of null_map outside of loop in ConvertImpl::execute for toString
2021-07-13 09:52:31 +03:00
vdimir
c938a53e88
Fixes for FunctionConversion implementation for nulls
2021-07-13 09:48:05 +03:00
vdimir
b4c6a17eb2
Add ReturnType template parameter to FormatImpl::execute
2021-07-13 09:48:05 +03:00
vdimir
32b174403e
Nullable in ConvertImplGenericToString
2021-07-13 09:48:04 +03:00
vdimir
3a0a456549
Do not try catch in ConvertImpl::execute
2021-07-13 09:48:04 +03:00
vdimir
5b18480a49
Return null if value can't be converted in toString for nullable
2021-07-13 09:48:04 +03:00
vdimir
7c4c2b29c2
Do not throw exception for unexpected values in enum during to string conversion
2021-07-13 09:48:04 +03:00
Anton Popov
072e65b728
Merge remote-tracking branch 'origin/sparse-serialization' into HEAD
2021-07-07 17:20:38 +03:00
neng.liu
ec7604b013
add parquet test and fix add interval error when type is date32
2021-06-28 16:36:54 +08:00
Neng Liu
7ed1728a37
Merge branch 'master' into datatype-date32
...
# Conflicts:
# src/DataTypes/IDataType.h
# src/Functions/CustomWeekTransforms.h
2021-06-22 10:00:18 +08:00
Alexey Milovidov
3e71181451
Whitespaces
2021-06-18 01:42:33 +03:00
Maksim Kita
67e9b85951
Merge ext into common
2021-06-16 23:28:41 +03:00
Neng Liu
88a0d0be62
add datetype32 part2
2021-06-08 20:31:41 +08:00
Anton Popov
205a23282b
Merge remote-tracking branch 'origin/sparse-serialization' into HEAD
2021-06-07 19:38:22 +03:00
mergify[bot]
d68d5e0ef1
Merge branch 'master' into rename-const-context-ptr
2021-06-04 14:41:41 +00:00
Kruglov Pavel
8acf031c1b
Merge pull request #24398 from Avogar/fix-deltasum
...
Fix logical error AggregateFunctionFactory returned nullptr
2021-06-03 19:40:06 +03:00
Nikolai Kochetov
dbaa6ffc62
Rename ContextConstPtr to ContextPtr.
2021-06-01 15:20:52 +03:00
Anton Popov
9f52362b81
Merge remote-tracking branch 'origin/sparse-serialization' into HEAD
2021-05-31 23:08:45 +03:00
Alexander Kuzmenkov
3f57fc085b
remove mutable context references from functions interface
...
Also remove it from some visitors.
2021-05-28 19:45:37 +03:00
Pavel Kruglov
42d57138f2
replace all isDateOrDateTime invocations to explicit calls to isDate and isDateTime and isDateTime64
2021-05-28 15:34:49 +03:00
Anton Popov
041e2def3e
fix conversion of tuples
2021-05-28 03:53:39 +03:00
Anton Popov
d83819fcae
fix build
2021-05-26 18:34:34 +03:00
Anton Popov
13ae56985f
dynamic subcolumns: better handling of missed values
2021-05-26 05:41:38 +03:00
Anton Popov
0bdf9d207c
Merge remote-tracking branch 'origin/sparse-serialization' into HEAD
2021-05-26 00:25:47 +03:00
Anton Popov
35e2cc7b2b
fix several cases in cast operator
2021-05-25 02:50:28 +03:00
Maksim Kita
fa24fe82e1
Fixed FunctionConversion tests
2021-05-16 18:17:05 +03:00
Maksim Kita
947f28d430
IFunction refactoring
2021-05-15 20:33:15 +03:00
Alexey Milovidov
02ce9cc725
Untangle UUID
2021-05-04 01:46:51 +03:00
Alexey Milovidov
0677787d90
Fix abysmally low performance
2021-05-03 22:56:40 +03:00
Alexey Milovidov
8ecd9d36e6
Add UInt128 conversion functions
2021-05-03 18:41:37 +03:00
Anton Popov
3bc2a0820c
dynamic subcolumns: support merges
2021-05-03 03:56:19 +03:00
Alexey Milovidov
649550c5ab
Attempt to normalize big integers
2021-04-25 12:30:43 +03:00
Maksim Kita
ddcffcb723
Fixed tests
2021-04-22 00:19:01 +03:00
Maksim Kita
631d870ae3
Cast to array from empty array
2021-04-21 20:29:49 +03:00
Ivan
495c6e03aa
Replace all Context references with std::weak_ptr ( #22297 )
...
* Replace all Context references with std::weak_ptr
* Fix shared context captured by value
* Fix build
* Fix Context with named sessions
* Fix copy context
* Fix gcc build
* Merge with master and fix build
* Fix gcc-9 build
2021-04-11 02:33:54 +03:00
Anton Popov
329c9033a8
fix conversion from const map with nulls
2021-04-09 20:50:10 +03:00
Anton Popov
6a15431be7
Merge remote-tracking branch 'upstream/master' into HEAD
2021-03-25 15:57:35 +03:00
alexey-milovidov
150a2df9df
Merge pull request #22026 from kitaisreal/cast-to-enum-nullable-fix
...
Cast to enum nullable fix
2021-03-23 23:51:19 +03:00
Maksim Kita
75f5679bf0
Cast to enum nullable fix
2021-03-23 14:58:00 +03:00
Alexey Milovidov
3f67f4f47b
Saturation for DateTime
2021-03-15 23:40:33 +03:00
Anton Popov
81ac6382a3
slightly better performance
2021-03-13 21:05:18 +03:00
Anton Popov
bc417cf54a
refactoring of serializations
2021-03-09 17:46:52 +03:00
Alexey Milovidov
4e8239e098
Merge branch 'master' into DateTime64_extended_range
2021-03-03 23:43:20 +03:00
Vasily Nemkov
2d03d330bc
Extended range of DateTime64 to years 1925 - 2238
...
The Year 1925 is a starting point because most of the timezones
switched to saner (mostly 15-minutes based) offsets somewhere
during 1924 or before. And that significantly simplifies implementation.
2238 is to simplify arithmetics for sanitizing LUT index access;
there are less than 0x1ffff days from 1925.
* Extended DateLUTImpl internal LUT to 0x1ffff items, some of which
represent negative (pre-1970) time values.
As a collateral benefit, Date now correctly supports dates up to 2149
(instead of 2106).
* Added a new strong typedef ExtendedDayNum, which represents dates
pre-1970 and post 2149.
* Functions that used to return DayNum now return ExtendedDayNum.
* Refactored DateLUTImpl to untie DayNum from the dual role of being
a value and an index (due to negative time). Index is now a different
type LUTIndex with explicit conversion functions from DatNum, time_t,
and ExtendedDayNum.
* Updated DateLUTImpl to properly support values close to epoch start
(1970-01-01 00:00), including negative ones.
* Reduced resolution of DateLUTImpl::Values::time_at_offset_change
to multiple of 15-minutes to allow storing 64-bits of time_t in
DateLUTImpl::Value while keeping same size.
* Minor performance updates to DateLUTImpl when building month LUT
by skipping non-start-of-month days.
* Fixed extractTimeZoneFromFunctionArguments to work correctly
with DateTime64.
* New unit-tests and stateless integration tests for both DateTime
and DateTime64.
2021-02-24 17:08:35 +02:00
hexiaoting
e123c6ef9d
Bug fix: Tuple cast to Map
2021-02-23 18:42:33 +08:00
Azat Khuzhin
521537eed8
Fix DateTime64 from Float
2021-02-21 22:36:40 +03:00
Alexey Milovidov
4085782b05
More gentle exception messages
2021-02-21 15:34:48 +03:00
Azat Khuzhin
46ff7d2ab0
Fix DateTime64 overflows
2021-02-07 02:24:31 +03:00
Azat Khuzhin
c4b5eed4ff
Fix DateTime64 initialization (to match DateTime behaviour)
...
There was no specializations for toDateTime64(<numeric>), and because of
this default decimal conversion was used, however this is not enough for
DateTime/DateTime64 types, since the date may overflow and the proper
check is required (like DateTime has), and this what UBsan found [1]:
../src/IO/WriteHelpers.h:812:33: runtime error: index 508 out of bounds for type 'const char [201]' Received signal -3 Received signal Unknown signal (-3)
Backtrace:
(gdb) bt
0 LocalDateTime::LocalDateTime (this=0x7fffffff8418, year_=1970, month_=1 '\001', day_=1 '\001', hour_=2 '\002', minute_=0 '\000', second_=254 '\376') at LocalDateTime.h:83
1 0x00000000138a5edb in DB::writeDateTimeText<(char)45, (char)58, (char)32, (char)46> (datetime64=..., scale=7, buf=..., date_lut=...) at WriteHelpers.h:852
2 0x0000000019c379b4 in DB::DataTypeDateTime64::serializeText (this=0x7ffff5c4b0d8, column=..., row_num=0, ostr=..., settings=...) at DataTypeDateTime64.cpp:66
3 0x0000000019d297e4 in DB::IDataType::serializeAsText (this=0x7ffff5c4b0d8, column=..., row_num=0, ostr=..., settings=...) at IDataType.cpp:387
[1]: https://clickhouse-test-reports.s3.yandex.net/19527/cea8ae162ffbf92e5ed29304ab010704c5d611c8/fuzzer_ubsan/report.html#fail1
Also fix CAST for DateTime64
2021-02-06 13:04:53 +03:00
Azat Khuzhin
0627ba0e36
Fix timezone argument for DateTime64
...
It should be marked with always const, otherwise it will bail:
Code: 44, e.displayText() = DB::Exception: Illegal column String of time zone argument of function, must be constant string: While processing toDateTime(-1, 1, 'GMT'), Stack trace (when copying this message, always include the lines below):
2021-02-06 13:04:53 +03:00
Maksim Kita
9db9ce11dc
Added functions parseDateTimeBestEffortUSOrZero, parseDateTimeBestEffortUSOrNull
2021-01-27 17:10:06 +03:00
Maksim Kita
d712748304
Function accurateCastOrNull fixed unitialized values for numeric cast
2021-01-22 16:24:51 +03:00
tavplubix
00d240853d
Merge pull request #18718 from zhang2014/fix/ISSUES-7690
...
ISSUES-7690 try fix nullable string type convert to decimal type
2021-01-11 16:18:56 +03:00
zhang2014
cccafcfc3d
try fix build failure
2021-01-08 18:29:51 +08:00
Alexey Milovidov
039edbb724
Don't allow conversion between UUID and numeric types
2021-01-05 01:33:59 +03:00
zhang2014
84ddff92f2
ISSUES-7690 try fix nullable string type convert to decimal type
2021-01-04 20:40:33 +08:00
Anton Popov
721bb60edd
fix cast to map from tuple of arrays with unequal sizes
2020-12-25 20:12:47 +03:00
Alexander Tokmakov
c49a6302fa
fix, add test
2020-12-24 03:13:53 +03:00
Alexander Tokmakov
317df5f5d2
try fix 'value is too short' when converting from String to Nullable(T)
2020-12-24 00:57:33 +03:00
alexey-milovidov
6fc3ca8b7b
Merge pull request #16724 from kitaisreal/added-function-accurate-cast-or-null
...
Added function accurateCastOrNull, allow different types inside IN subquery
2020-12-18 00:45:27 +03:00
Maksim Kita
9aaa2f9345
Fixed compilation timeout
2020-12-17 21:32:25 +03:00
Anton Popov
b485b5bd1c
minor fixes and comments added
2020-12-16 01:22:21 +03:00
Maksim Kita
4e3cc606e6
Fixed tests
2020-12-15 23:36:45 +03:00
Maksim Kita
51f53ce8e9
Added tryParseDecimal functions
2020-12-15 21:54:16 +03:00