[ 
https://issues.apache.org/jira/browse/BEAM-9379?focusedWorklogId=579508&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-579508
 ]

ASF GitHub Bot logged work on BEAM-9379:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Apr/21 19:45
            Start Date: 08/Apr/21 19:45
    Worklog Time Spent: 10m 
      Work Description: 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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 579508)
    Time Spent: 11h 20m  (was: 11h 10m)

> Upgrade to Calcite 1.26.0
> -------------------------
>
>                 Key: BEAM-9379
>                 URL: https://issues.apache.org/jira/browse/BEAM-9379
>             Project: Beam
>          Issue Type: Task
>          Components: dsl-sql
>            Reporter: Rui Wang
>            Assignee: Andrew Pilloud
>            Priority: P2
>          Time Spent: 11h 20m
>  Remaining Estimate: 0h
>
> Upgrade to Calcite 1.22.0 after it gets released (expected by end of Feb 
> 2020).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to