From 992b9809c69fc6e5540baa2c12330f4333ebef7f Mon Sep 17 00:00:00 2001 From: Chandra Sanapala Date: Thu, 25 Jul 2024 15:38:20 +0530 Subject: [PATCH] Make supported types as map[sting]struct --- dialects/cudf.yaml | 30 ++++++++++++++++++--------- dialects/datafusion.yaml | 36 +++++++++++++++++++++----------- dialects/duckdb.yaml | 42 +++++++++++++++++++++++++------------- dialects/postgres.yaml | 36 +++++++++++++++++++++----------- dialects/snowflake.yaml | 24 ++++++++++++++-------- dialects/sqlite.yaml | 24 ++++++++++++++-------- dialects/velox_presto.yaml | 12 +++++++---- 7 files changed, 136 insertions(+), 68 deletions(-) diff --git a/dialects/cudf.yaml b/dialects/cudf.yaml index 7c0f037..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: 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 diff --git a/dialects/datafusion.yaml b/dialects/datafusion.yaml index 7d4c179..1a98829 100644 --- a/dialects/datafusion.yaml +++ b/dialects/datafusion.yaml @@ -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: + diff --git a/dialects/duckdb.yaml b/dialects/duckdb.yaml index fb0da70..4d71987 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: 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: + diff --git a/dialects/postgres.yaml b/dialects/postgres.yaml index 42da2da..3b5d00e 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: 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: + diff --git a/dialects/snowflake.yaml b/dialects/snowflake.yaml index 9f5420d..8be84de 100644 --- a/dialects/snowflake.yaml +++ b/dialects/snowflake.yaml @@ -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: + diff --git a/dialects/sqlite.yaml b/dialects/sqlite.yaml index eabd3dc..5f77819 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: 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: + diff --git a/dialects/velox_presto.yaml b/dialects/velox_presto.yaml index 1fda49d..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: 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: +