-
Notifications
You must be signed in to change notification settings - Fork 752
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(query): fix incorrect total_bytes_len in string view (#16877)
* update * update * update * update * update
- Loading branch information
Showing
4 changed files
with
91 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
query T | ||
SELECT '1'::string from numbers(3) | ||
---- | ||
1 | ||
1 | ||
1 | ||
|
||
query T | ||
SELECT {'w1vY1t5':-15239676694.972677,'6UfU721':-4905646705.765232} from numbers(3); | ||
---- | ||
{'w1vY1t5':-15239676694.972677,'6UfU721':-4905646705.765232} | ||
{'w1vY1t5':-15239676694.972677,'6UfU721':-4905646705.765232} | ||
{'w1vY1t5':-15239676694.972677,'6UfU721':-4905646705.765232} | ||
|
||
|
||
# String concatenation | ||
query T | ||
SELECT 'hello' || ' ' || 'world' FROM numbers(1); | ||
---- | ||
hello world | ||
|
||
query T | ||
SELECT '!@#$%^&*()'::string, '你好'::string, '🌟'::string; | ||
---- | ||
!@#$%^&*() 你好 🌟 | ||
|
||
# String with escape sequences | ||
query T | ||
SELECT 'line1-line2'::string, 'tab\there'::string; | ||
---- | ||
line1-line2 tab here | ||
|
||
query T | ||
SELECT UPPER('hello'), LOWER('WORLD'), LENGTH('databend') FROM numbers(1); | ||
---- | ||
HELLO world 8 | ||
|
||
# String with JSON objects | ||
query T | ||
SELECT {'key': 'value'::string, 'numbers': 123::string} FROM numbers(2); | ||
---- | ||
{'key':'value','numbers':'123'} | ||
{'key':'value','numbers':'123'} | ||
|
||
|
||
# String with scientific notation | ||
query T | ||
SELECT {'scientific': 1.23e-4, 'regular': 123.456} FROM numbers(1); | ||
---- | ||
{'scientific':0.000123,'regular':123.456000} | ||
|
||
|
||
# String with very long content | ||
query T | ||
SELECT repeat('a', 100)::string FROM numbers(1); | ||
---- | ||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | ||
|
||
# String with whitespace handling | ||
query T | ||
SELECT TRIM(' spaced ')::string, LTRIM(' left')::string, RTRIM('right ')::string; | ||
---- | ||
spaced left right | ||
|
||
# String with NULL values | ||
query T | ||
SELECT NULL::string, COALESCE(NULL::string, 'default') FROM numbers(1); | ||
---- | ||
NULL default |