apache / apache/beam

[Feature Request]: Support sql types with argument in CalciteUtils

Open
#24,019 0 comments 0 reactions 0 assignees View on GitHub
dsl new feature P3 sql
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

### What would you like to happen?

Currently, we omitted arguments when converting from/to `SqlTypeName.VARBINARY, SqlTypeName.BINARY, SqlTypeName.VARCHAR, SqlTypeName.CHAR` types in Calcite.Utils:
https://github.com/apache/beam/blob/d4142f7eab7d5a3d21a3d3930c448fe403880f93/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/utils/CalciteUtils.java#L312

To create sql types, we should use the overload method `RelDataTypeFactory.createSqlType(SqlTypeName, int)` which accepts a second int parameter to construct these types;
To create beam logical types, we should obtain the precision parameter of the Calcite type.

### Issue Priority

Priority: 3

### Issue Component

Component: dsl-sql

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.