Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e0485fc
Fail all 10 regexp expressions for non-binary collations
uros-db Mar 7, 2024
355eee9
Reformat code
uros-db Mar 8, 2024
cde9eff
Refactoring and better test coverage
uros-db Mar 12, 2024
616335b
Lockdown using StringType
uros-db Mar 13, 2024
e6bec45
Merge branch 'apache:master' into regexp-functions
uros-db Mar 13, 2024
77e606c
Lockdown for regexpExpressions
uros-db Mar 13, 2024
ee72ed3
Renaming and small fixes
uros-db Mar 13, 2024
8bc10f5
Code style fixes
uros-db Mar 13, 2024
8ee0f58
Move StringType lockdown condition to case object
uros-db Mar 13, 2024
d3a9e70
Fix checkInputDataTypes
uros-db Mar 14, 2024
c11c458
Implicit cast for new StringTypes
uros-db Mar 14, 2024
4778951
Implicit cast for new StringTypes
uros-db Mar 14, 2024
1582f24
Separate suite for stringExpressions
uros-db Mar 14, 2024
8d75846
Collation test fix
uros-db Mar 14, 2024
63caef6
Reformat
uros-db Mar 15, 2024
38c3906
Remove extra changes
uros-db Mar 15, 2024
1d60cef
Rewrite collation mismatch check
uros-db Mar 15, 2024
2f5aba9
Improve lockdown handling
uros-db Mar 15, 2024
b9b185d
Add ANSI type coercion
uros-db Mar 15, 2024
3fed6cb
Better ANSI type coercion explanation
uros-db Mar 15, 2024
638c6d4
Fix type coercion
uros-db Mar 15, 2024
af7611f
Fix ANSI type coercion
uros-db Mar 17, 2024
ceabb4a
Merge branch 'apache:master' into regexp-functions
uros-db Mar 17, 2024
0f4a6b1
Fix failing tests
mihailomilosevic2001 Mar 19, 2024
9b24fba
Incorporate requested changes
mihailomilosevic2001 Mar 19, 2024
831197a
Merge branch 'apache:master' into regexp-functions
mihailomilosevic2001 Mar 20, 2024
99b36b0
Refactor code and fix comments
mihailomilosevic2001 Mar 20, 2024
9051923
Fix newlines
mihailomilosevic2001 Mar 20, 2024
6986b8b
Add back newlines
mihailomilosevic2001 Mar 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rewrite collation mismatch check
  • Loading branch information
uros-db committed Mar 15, 2024
commit 1d60cefdac09a5e646eb7e9acb02054085bfb7cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,17 @@ object CollationTypeConstraints {
def checkCollationCompatibility(collationId: Int, dataTypes: Seq[DataType]): TypeCheckResult = {
val collationName = CollationFactory.fetchCollation(collationId).collationName
// Additional check needed for collation compatibility
for (dataType <- dataTypes) {
dataType match {
case stringType: StringType =>
if (stringType.collationId != collationId) {
val collation = CollationFactory.fetchCollation(stringType.collationId)
return DataTypeMismatch(
errorSubClass = "COLLATION_MISMATCH",
messageParameters = Map(
"collationNameLeft" -> collationName,
"collationNameRight" -> collation.collationName
)
)
}
case _ =>
}
}
TypeCheckResult.TypeCheckSuccess
dataTypes.collectFirst {
case stringType: StringType if stringType.collationId != collationId =>
val collation = CollationFactory.fetchCollation(stringType.collationId)
DataTypeMismatch(
errorSubClass = "COLLATION_MISMATCH",
messageParameters = Map(
"collationNameLeft" -> collationName,
"collationNameRight" -> collation.collationName
)
)
} getOrElse TypeCheckResult.TypeCheckSuccess
}

}