[
https://issues.apache.org/jira/browse/BEAM-4082?focusedWorklogId=107269&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-107269
]
ASF GitHub Bot logged work on BEAM-4082:
----------------------------------------
Author: ASF GitHub Bot
Created on: 30/May/18 17:51
Start Date: 30/May/18 17:51
Worklog Time Spent: 10m
Work Description: akedin commented on a change in pull request #5497:
[BEAM-4082] Migrate from builders in RowSqlTypes to just using Schema builder
directly
URL: https://github.com/apache/beam/pull/5497#discussion_r191860450
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/utils/CalciteUtils.java
##########
@@ -67,6 +67,21 @@
private static final BiMap<SqlTypeName, FieldType>
CALCITE_TO_BEAM_TYPE_MAPPING =
BEAM_TO_CALCITE_TYPE_MAPPING.inverse();
+ // The list of field type names used in SQL as Beam field types.
+ public static final FieldType TINY_INT = toFieldType(SqlTypeName.TINYINT);
+ public static final FieldType SMALL_INT = toFieldType(SqlTypeName.SMALLINT);
+ public static final FieldType INTEGER = toFieldType(SqlTypeName.INTEGER);
+ public static final FieldType BIG_INT = toFieldType(SqlTypeName.BIGINT);
+ public static final FieldType FLOAT = toFieldType(SqlTypeName.FLOAT);
+ public static final FieldType DOUBLE = toFieldType(SqlTypeName.DOUBLE);
+ public static final FieldType DECIMAL = toFieldType(SqlTypeName.DECIMAL);
+ public static final FieldType BOOLEAN = toFieldType(SqlTypeName.BOOLEAN);
+ public static final FieldType CHAR = toFieldType(SqlTypeName.CHAR);
+ public static final FieldType VARCHAR = toFieldType(SqlTypeName.VARCHAR);
Review comment:
The main reason I was reluctant to delete the `RowSqlTypes` is because
Calcite has different type names than our schema, and it can be confusing when
mixed together, contrived example:
```
Schema
.builder()
.addInt32Field("f_int")
.addField(Field.of("f_alsoInt", CalciteUtils.INTEGER))
.addDateTimeField("f_dateTime")
.addField(Field.of("f_timestamp", CalciteUtils.TIMESTAMP))
.addStringField("f_str")
.addField(Field.of("f_char", CalciteUtils.CHAR)
.addField(Field.of("f_varchar", CalciteUtils.VARCHAR)
.build()
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 107269)
Time Spent: 0.5h (was: 20m)
> remove RowSqlTypeBuilder
> ------------------------
>
> Key: BEAM-4082
> URL: https://issues.apache.org/jira/browse/BEAM-4082
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-java-core
> Reporter: Kenneth Knowles
> Assignee: Kenneth Knowles
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Quoting the PR, this should be removed.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)