Skip to content

Port tests in cast.rs to sqllogictest #6244

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

Merged
merged 3 commits into from
May 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
76 changes: 0 additions & 76 deletions datafusion/core/tests/sql/cast.rs

This file was deleted.

1 change: 0 additions & 1 deletion datafusion/core/tests/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ macro_rules! test_expression {
pub mod aggregates;
#[cfg(feature = "avro")]
pub mod avro;
pub mod cast;
pub mod create_drop;
pub mod errors;
pub mod explain_analyze;
Expand Down
58 changes: 58 additions & 0 deletions datafusion/core/tests/sqllogictests/test_files/cast.slt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# cast from subquery
query T
SELECT cast(c as varchar) FROM (SELECT 1 as c)
----
1

# cast tinyint
query I
SELECT cast(10 as tinyint)
----
10

# cast tinyint operator
query I
SELECT 10::tinyint
----
10

# cast unsigned tinyint
query I
SELECT 10::tinyint unsigned
----
10

# cast unsigned smallint
query I
SELECT 10::smallint unsigned
----
10

# cast unsigned int
query I
SELECT 10::integer unsigned
----
10

# cast unsigned bigint
query I
SELECT 10::bigint unsigned
----
10