Skip to content

Commit

Permalink
Make supported types as map[sting]struct
Browse files Browse the repository at this point in the history
  • Loading branch information
scgkiran committed Jul 25, 2024
1 parent d950475 commit 992b980
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 68 deletions.
30 changes: 20 additions & 10 deletions dialects/cudf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,26 @@ dependencies:
string:
https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml
supported_types:
i8: int8
i16: int16
i32: int32
i64: int64
fp32: float32
fp64: float64
bool: bool
str: string
ts: datetime64[s]
date: datetime64[s]
i8:
df_type_name: int8
i16:
df_type_name: int16
i32:
df_type_name: int32
i64:
df_type_name: int64
fp32:
df_type_name: float32
fp64:
df_type_name: float64
bool:
df_type_name: bool
str:
df_type_name: string
ts:
df_type_name: datetime64[s]
date:
df_type_name: datetime64[s]
scalar_functions:
- name: arithmetic.add
local_name: add
Expand Down
36 changes: 24 additions & 12 deletions dialects/datafusion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,30 @@ dependencies:
string:
https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml
supported_types:
i8: int8
i16: int16
i32: int32
i64: int64
fp32: float32
fp64: float64
bool: bool_
str: string
date: timestamp
time: timestamp
ts: timestamp
tstz: timestamp
i8:
sql_type_name: int8
i16:
sql_type_name: int16
i32:
sql_type_name: int32
i64:
sql_type_name: int64
fp32:
sql_type_name: float32
fp64:
sql_type_name: float64
bool:
sql_type_name: bool_
str:
sql_type_name: string
date:
sql_type_name: timestamp
time:
sql_type_name: timestamp
ts:
sql_type_name: timestamp
tstz:
sql_type_name: timestamp
scalar_functions:
- name: arithmetic.add
local_name: +
Expand Down
42 changes: 28 additions & 14 deletions dialects/duckdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,34 @@ dependencies:
string:
https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml
supported_types:
i8: TINYINT,
i16: SMALLINT
i32: INTEGER
i64: BIGINT
fp32: REAL
fp64: DOUBLE
bool: BOOLEAN
str: VARCHAR
date: DATE
time: TIME
ts: TIMESTAMP
tstz: TIMESTAMPTZ
interval: INTERVAL
decimal: DECIMAL
i8:
sql_type_name: TINYINT,
i16:
sql_type_name: SMALLINT
i32:
sql_type_name: INTEGER
i64:
sql_type_name: BIGINT
fp32:
sql_type_name: REAL
fp64:
sql_type_name: DOUBLE
bool:
sql_type_name: BOOLEAN
str:
sql_type_name: VARCHAR
date:
sql_type_name: DATE
time:
sql_type_name: TIME
ts:
sql_type_name: TIMESTAMP
tstz:
sql_type_name: TIMESTAMPTZ
interval:
sql_type_name: INTERVAL
decimal:
sql_type_name: DECIMAL
scalar_functions:
- name: arithmetic.add
local_name: +
Expand Down
36 changes: 24 additions & 12 deletions dialects/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,30 @@ dependencies:
string:
https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml
supported_types:
i16: smallint
i32: integer
i64: bigint
fp32: float4
fp64: float8
bool: boolean
str: text
date: date
time: time
ts: timestamp
tstz: timestamptz
interval: interval
i16:
sql_type_name: smallint
i32:
sql_type_name: integer
i64:
sql_type_name: bigint
fp32:
sql_type_name: float4
fp64:
sql_type_name: float8
bool:
sql_type_name: boolean
str:
sql_type_name: text
date:
sql_type_name: date
time:
sql_type_name: time
ts:
sql_type_name: timestamp
tstz:
sql_type_name: timestamptz
interval:
sql_type_name: interval
scalar_functions:
- name: arithmetic.add
local_name: +
Expand Down
24 changes: 16 additions & 8 deletions dialects/snowflake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,22 @@ dependencies:
string:
https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml
supported_types:
fp64: FLOAT
bool: BOOLEAN
str: VARCHAR
date: DATE
time: TIME
ts: TIMESTAMP
tstz: TIMESTAMPTZ
interval: INTERVAL
fp64:
sql_type_name: FLOAT
bool:
sql_type_name: BOOLEAN
str:
sql_type_name: VARCHAR
date:
sql_type_name: DATE
time:
sql_type_name: TIME
ts:
sql_type_name: TIMESTAMP
tstz:
sql_type_name: TIMESTAMPTZ
interval:
sql_type_name: INTERVAL
scalar_functions:
- name: arithmetic.add
local_name: +
Expand Down
24 changes: 16 additions & 8 deletions dialects/sqlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,22 @@ dependencies:
string:
https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml
supported_types:
i8: TINYINT
i16: SMALLINT
i32: INT
i64: HUGEINT
fp32: REAL
fp64: REAL
bool: BOOLEAN
str: TEXT
i8:
sql_type_name: TINYINT
i16:
sql_type_name: SMALLINT
i32:
sql_type_name: INT
i64:
sql_type_name: HUGEINT
fp32:
sql_type_name: REAL
fp64:
sql_type_name: REAL
bool:
sql_type_name: BOOLEAN
str:
sql_type_name: TEXT
scalar_functions:
- name: arithmetic.add
local_name: +
Expand Down
12 changes: 8 additions & 4 deletions dialects/velox_presto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ dependencies:
string:
https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml
supported_types:
i64: i64
fp64: fp64
bool: boolean
str: string
i64:
sql_type_name: i64
fp64:
sql_type_name: fp64
bool:
sql_type_name: boolean
str:
sql_type_name: string
scalar_functions:
- name: arithmetic.add
local_name: +
Expand Down

0 comments on commit 992b980

Please sign in to comment.