diff --git a/bft/dialects/types.py b/bft/dialects/types.py index a7f050f..f36ff58 100644 --- a/bft/dialects/types.py +++ b/bft/dialects/types.py @@ -83,7 +83,7 @@ class DialectFile(NamedTuple): scalar_functions: List[DialectFunction] aggregate_functions: List[DialectFunction] uri_to_func_prefix: Dict[str, str] - supported_types: List[str] + supported_types: Dict[str, Dict] class SqlMapping(NamedTuple): diff --git a/dialects/cudf.yaml b/dialects/cudf.yaml index bd2a760..2080cd1 100644 --- a/dialects/cudf.yaml +++ b/dialects/cudf.yaml @@ -26,16 +26,26 @@ dependencies: string: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml supported_types: - - i8 - - i16 - - i32 - - i64 - - fp32 - - fp64 - - bool - - str - - ts - - date + 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 diff --git a/dialects/datafusion.yaml b/dialects/datafusion.yaml index 1f7b5b4..9ee461d 100644 --- a/dialects/datafusion.yaml +++ b/dialects/datafusion.yaml @@ -26,19 +26,30 @@ dependencies: string: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml supported_types: - - i8 - - i16 - - i32 - - i64 - - fp32 - - fp64 - - bool - - str - - date - - time - - ts - - tstz - - interval + 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: + diff --git a/dialects/duckdb.yaml b/dialects/duckdb.yaml index 9a971f7..a8e4f80 100644 --- a/dialects/duckdb.yaml +++ b/dialects/duckdb.yaml @@ -26,20 +26,34 @@ dependencies: string: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml supported_types: - - i8 - - i16 - - i32 - - i64 - - fp32 - - fp64 - - bool - - str - - date - - time - - ts - - tstz - - interval - - dec + 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: + diff --git a/dialects/postgres.yaml b/dialects/postgres.yaml index 2807fe1..4fd80a3 100644 --- a/dialects/postgres.yaml +++ b/dialects/postgres.yaml @@ -26,18 +26,30 @@ dependencies: string: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml supported_types: - - i16 - - i32 - - i64 - - fp32 - - fp64 - - bool - - str - - date - - time - - ts - - tstz - - 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: + diff --git a/dialects/snowflake.yaml b/dialects/snowflake.yaml index f00f463..9f37c83 100644 --- a/dialects/snowflake.yaml +++ b/dialects/snowflake.yaml @@ -26,15 +26,25 @@ dependencies: string: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml supported_types: - - fp64 - - bool - - str - - date - - time - - ts - - tsz - - interval - - dec + 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 + supported_as_column: false + dec: + sql_type_name: numeric scalar_functions: - name: arithmetic.add local_name: + diff --git a/dialects/sqlite.yaml b/dialects/sqlite.yaml index 9fdfbc0..930d051 100644 --- a/dialects/sqlite.yaml +++ b/dialects/sqlite.yaml @@ -26,14 +26,22 @@ dependencies: string: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml supported_types: - - i8 - - i16 - - i32 - - i64 - - fp32 - - fp64 - - bool - - str + 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: + diff --git a/dialects/velox_presto.yaml b/dialects/velox_presto.yaml index c1d47f7..afddeb1 100644 --- a/dialects/velox_presto.yaml +++ b/dialects/velox_presto.yaml @@ -26,10 +26,14 @@ dependencies: string: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_string.yaml supported_types: - - i64 - - fp64 - - bool - - str + 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: +