Skip to content

Commit 735192d

Browse files
authored
feat(type): add support for double precision (#153)
* feat(type): add support for double precision * code format * remove DoublePrecision LogicalType
1 parent cd5ffc2 commit 735192d

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

src/types/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,9 @@ impl TryFrom<sqlparser::ast::DataType> for LogicalType {
305305
Ok(LogicalType::Varchar(len.map(|len| len.length as u32)))
306306
}
307307
sqlparser::ast::DataType::Float(_) => Ok(LogicalType::Float),
308-
sqlparser::ast::DataType::Double => Ok(LogicalType::Double),
308+
sqlparser::ast::DataType::Double | sqlparser::ast::DataType::DoublePrecision => {
309+
Ok(LogicalType::Double)
310+
}
309311
sqlparser::ast::DataType::TinyInt(_) => Ok(LogicalType::Tinyint),
310312
sqlparser::ast::DataType::UnsignedTinyInt(_) => Ok(LogicalType::UTinyint),
311313
sqlparser::ast::DataType::SmallInt(_) => Ok(LogicalType::Smallint),

tests/slt/sql_2016/E011_02.slt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
# E011-02: REAL, DOUBLE PRECISON, and FLOAT data types
1+
# E011-02: REAL, DOUBLE PRECISION, and FLOAT data types
22

3-
# TODO: DOUBLE PRECISION
4-
# statement ok
5-
# CREATE TABLE TABLE_E011_02_01_01 ( ID INT PRIMARY KEY, A DOUBLE PRECISION )
3+
statement ok
4+
CREATE TABLE TABLE_E011_02_01_01 ( ID INT PRIMARY KEY, A DOUBLE PRECISION )
65

76
statement ok
87
CREATE TABLE TABLE_E011_02_01_02 ( ID INT PRIMARY KEY, A FLOAT ( 2 ) )

0 commit comments

Comments
 (0)