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

VARCHAR and INT comparison in query #5414

Open
metesynnada opened this issue Feb 27, 2023 · 1 comment
Open

VARCHAR and INT comparison in query #5414

metesynnada opened this issue Feb 27, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@metesynnada
Copy link
Contributor

metesynnada commented Feb 27, 2023

Describe the bug
It does not yield an error when comparing VARCHAR and integer.

// create local execution context
let ctx = SessionContext::new();
let testdata = datafusion::test_util::arrow_test_data();
ctx.sql(&format!(
    "CREATE EXTERNAL TABLE aggregate_test_100 (
    c1  VARCHAR NOT NULL,
    c2  TINYINT NOT NULL,
    c3  SMALLINT NOT NULL,
    c4  SMALLINT NOT NULL,
    c5  INTEGER NOT NULL,
    c6  BIGINT NOT NULL,
    c7  SMALLINT NOT NULL,
    c8  INT NOT NULL,
    c9  INT UNSIGNED NOT NULL,
    c10 BIGINT UNSIGNED NOT NULL,
    c11 FLOAT NOT NULL,
    c12 DOUBLE NOT NULL,
    c13 VARCHAR NOT NULL
)
STORED AS CSV
WITH HEADER ROW
LOCATION '{testdata}/csv/aggregate_test_100.csv'"
))
.await?;
let df = ctx.sql( "SELECT c1, c2 FROM aggregate_test_100
  WHERE c1 < 10").await?;
assert!(df.collect().await.is_err());

To Reproduce
Use the code above in a test.

Expected behavior
Error throw. In PostgreSQL: Query Error: error: operator does not exist: character varying < integer

Additional context
NA

@metesynnada metesynnada added the bug Something isn't working label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants