Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangstar333 committed Dec 1, 2023
1 parent 998c779 commit f5d0f03
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ public static Map<String, AddPartitionClause> getAddPartitionClauseFromPartition
partitionName += getFormatPartitionValue(filterStr);
if (partitionColumnType.isStringType()) {
if (partitionName.length() > 50) {
partitionName = partitionName.substring(40) + Objects.hash(partitionName) + "_" + System.currentTimeMillis();
partitionName = partitionName.substring(40) + Objects.hash(partitionName)
+ "_" + System.currentTimeMillis();
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !sql1 --


!
!
Xxx
xxX
1
2
! 3
! 4
Xxx 3
xxX 3

-- !sql2 --


!
!
Xxx
xxX
1
2
! 3
! 4
Xxx 3
xxX 3

-- !sql3 --

!
!
-
-
- -
--
Xxx
xxX
2
! 3
! 4
- 3
- 1
- - 3
-- 2
Xxx 3
xxX 3

-- !sql4 --
2

-- !sql5 --
1
Expand All @@ -49,46 +50,46 @@ Xxx
xxX

-- !sql2 --




!
!
!
!
Xxx
Xxx
xxX
xxX
1
1
2
2
! 3
! 3
! 4
! 4
Xxx 3
Xxx 3
xxX 3
xxX 3

-- !sql3 --


!
!
!
!
-
-
- -
--
Xxx
Xxx
xxX
xxX
2
2
! 3
! 3
! 4
! 4
- 3
- 1
- - 3
-- 2
Xxx 3
Xxx 3
xxX 3
xxX 3

-- !sql4 --
!
!
-
-
- -
--
Xxx
Xxx
xxX
xxX
! 4
! 4
- 3
- 1
- - 3
-- 2
Xxx 3
Xxx 3
xxX 3
xxX 3

-- !sql1 --
2009-12-12T00:00 2020-12-12T00:00
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ suite("test_auto_partition_behavior") {
"""
// special characters
sql """ insert into unique_table values (" "), (" "), ("Xxx"), ("xxX"), (" ! "), (" ! ") """
qt_sql1 """ select * from unique_table order by `str` """
qt_sql1 """ select *,length(str) from unique_table order by `str` """
def result = sql "show partitions from unique_table"
assertEquals(result.size(), 6)
sql """ insert into unique_table values (" "), (" "), ("Xxx"), ("xxX"), (" ! "), (" ! ") """
qt_sql2 """ select * from unique_table order by `str` """
qt_sql2 """ select *,length(str) from unique_table order by `str` """
result = sql "show partitions from unique_table"
assertEquals(result.size(), 6)
sql """ insert into unique_table values ("-"), ("--"), ("- -"), (" - ") """
Expand All @@ -51,10 +51,10 @@ suite("test_auto_partition_behavior") {
sql """ alter table unique_table drop partition ${partition1_name} """ // partition ' '
result = sql "show partitions from unique_table"
assertEquals(result.size(), 9)
qt_sql3 """ select * from unique_table order by `str` """
qt_sql3 """ select *,length(str) from unique_table order by `str` """
// modify value
sql """ update unique_table set str = "modified" where str in (" ", " ") """ // only " "
qt_sql4 """ select * from unique_table where str = ' ' order by `str` """ // modified
qt_sql4 """ select *,length(str) from unique_table where str = ' ' order by `str` """ // modified
qt_sql5 """ select count() from unique_table where str = 'modified' """
// crop
qt_sql6 """ select * from unique_table where ((str > ' ! ' || str = 'modified') && str != 'Xxx') order by str """
Expand Down Expand Up @@ -83,7 +83,7 @@ suite("test_auto_partition_behavior") {
result = sql "show partitions from dup_table"
assertEquals(result.size(), 6)
sql """ insert into dup_table values (" "), (" "), ("Xxx"), ("xxX"), (" ! "), (" ! ") """
qt_sql2 """ select * from dup_table order by `str` """
qt_sql2 """ select *,length(str) from dup_table order by `str` """
result = sql "show partitions from dup_table"
assertEquals(result.size(), 6)
sql """ insert into dup_table values ("-"), ("--"), ("- -"), (" - ") """
Expand All @@ -95,9 +95,9 @@ suite("test_auto_partition_behavior") {
sql """ alter table dup_table drop partition ${partition1_name} """
result = sql "show partitions from dup_table"
assertEquals(result.size(), 9)
qt_sql3 """ select * from dup_table order by `str` """
qt_sql3 """ select *,length(str) from dup_table order by `str` """
// crop
qt_sql4 """ select * from dup_table where str > ' ! ' order by str """
qt_sql4 """ select * ,length(str) from dup_table where str > ' ! ' order by str """

/// agg key table
sql "drop table if exists agg_dt6"
Expand Down

0 comments on commit f5d0f03

Please sign in to comment.