Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CALCITE-6756] Preserving CAST of STRING operand in binary comparison… #4151

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -7971,15 +7971,17 @@ private void checkLiteral2(String expression, String expected) {
+ "\"birth_date\" = cast('1914-02-02' as date) or "
ILuffZhe marked this conversation as resolved.
Show resolved Hide resolved
+ "\"hire_date\" = cast('1996-01-01 '||'00:00:00' as timestamp) or "
+ "\"hire_date\" = '1996-01-01 00:00:00' or "
+ "cast(\"full_name\" as timestamp) = \"hire_date\"";
+ "cast(\"full_name\" as timestamp) = \"hire_date\" or "
+ "cast('10' as varchar) = 1";
ILuffZhe marked this conversation as resolved.
Show resolved Hide resolved
ILuffZhe marked this conversation as resolved.
Show resolved Hide resolved
final String expectedPostgresql = "SELECT \"employee_id\"\n"
+ "FROM \"foodmart\".\"employee\"\n"
+ "WHERE 10 = CAST(\"full_name\" AS INTEGER) AND "
+ "\"first_name\" > CAST(10 AS VARCHAR) AND "
+ "\"birth_date\" = '1914-02-02' OR "
+ "\"hire_date\" = CAST('1996-01-01 ' || '00:00:00' AS TIMESTAMP(0)) OR "
+ "\"hire_date\" = '1996-01-01 00:00:00' OR "
+ "CAST(\"full_name\" AS TIMESTAMP(0)) = \"hire_date\"";
+ "CAST(\"full_name\" AS TIMESTAMP(0)) = \"hire_date\" OR "
+ "CAST('10' AS INTEGER) = 1";
sql(query)
.withPostgresql().ok(expectedPostgresql);
}
Expand Down
Loading