apilloud commented on a change in pull request #13930:
URL: https://github.com/apache/beam/pull/13930#discussion_r610044800
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamCalcRel.java
##########
@@ -468,66 +440,174 @@ private static Expression value(
final Expression expression = list.append(list.newName("current"),
input);
- FieldType fromType = schema.getField(index).getType();
- Class convertTo = null;
- if (storageType == Object.class) {
- convertTo = Object.class;
- } else if (fromType.getTypeName().isLogicalType()) {
- convertTo =
LOGICAL_TYPE_TO_BASE_TYPE_MAP.get(fromType.getLogicalType().getIdentifier());
- } else {
- convertTo = TYPE_CONVERSION_MAP.get(fromType.getTypeName());
- }
- if (convertTo == null) {
- throw new UnsupportedOperationException("Unable to get " +
fromType.getTypeName());
+ FieldType fieldType = schema.getField(index).getType();
+ Expression value;
+ switch (fieldType.getTypeName()) {
+ case BYTE:
+ value = Expressions.call(expression, "getByte",
Expressions.constant(index));
Review comment:
Added a comment at the top of the function: `Read field from Beam Row`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]