Skip to content

Commit

Permalink
Add test for nullable doesn't work when create memory table (apache#1…
Browse files Browse the repository at this point in the history
…4624)

* Add test for nullable doesn't work when create memory table

* change location
  • Loading branch information
xudong963 authored Feb 13, 2025
1 parent 0a57469 commit 3e6d70e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions datafusion/sqllogictest/test_files/ddl.slt
Original file line number Diff line number Diff line change
Expand Up @@ -840,3 +840,31 @@ DROP TABLE t1;

statement ok
DROP TABLE t2;

# Test memory table fields with correct nullable
statement ok
CREATE or replace TABLE table_with_pk (
sn INT PRIMARY KEY NOT NULL,
ts TIMESTAMP WITH TIME ZONE NOT NULL,
currency VARCHAR(3) NOT NULL,
amount FLOAT
) as VALUES
(0, '2022-01-01 06:00:00Z'::timestamp, 'EUR', 30.0),
(1, '2022-01-01 08:00:00Z'::timestamp, 'EUR', 50.0),
(2, '2022-01-01 11:30:00Z'::timestamp, 'TRY', 75.0),
(3, '2022-01-02 12:00:00Z'::timestamp, 'EUR', 200.0);

query TTTTTT
show columns FROM table_with_pk;
----
datafusion public table_with_pk sn Int32 NO
datafusion public table_with_pk ts Timestamp(Nanosecond, Some("+00:00")) NO
datafusion public table_with_pk currency Utf8 NO
datafusion public table_with_pk amount Float32 YES

statement ok
drop table table_with_pk;

statement ok
set datafusion.catalog.information_schema = false;

0 comments on commit 3e6d70e

Please sign in to comment.