[
https://issues.apache.org/jira/browse/BEAM-12691?focusedWorklogId=649537&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-649537
]
ASF GitHub Bot logged work on BEAM-12691:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Sep/21 00:02
Start Date: 11/Sep/21 00:02
Worklog Time Spent: 10m
Work Description: apilloud commented on a change in pull request #15486:
URL: https://github.com/apache/beam/pull/15486#discussion_r706525088
##########
File path:
sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamCalcRel.java
##########
@@ -207,20 +204,28 @@ public Calc copy(RelTraitSet traitSet, RelNode input,
RexProgram program) {
private final Schema outputSchema;
private final boolean verifyRowValues;
private final List<String> jarPaths;
+
+ @FieldAccess("row")
+ private final FieldAccessDescriptor fieldAccess;
+
private transient @Nullable ScriptEvaluator se = null;
public CalcFn(
String processElementBlock,
Schema outputSchema,
boolean verifyRowValues,
- List<String> jarPaths) {
+ List<String> jarPaths,
+ FieldAccessDescriptor fieldAccess) {
this.processElementBlock = processElementBlock;
this.outputSchema = outputSchema;
this.verifyRowValues = verifyRowValues;
this.jarPaths = jarPaths;
+ this.fieldAccess = fieldAccess;
+
+ compile(processElementBlock, jarPaths);
Review comment:
Done.
##########
File path:
sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/BeamZetaSqlCalcRel.java
##########
@@ -190,10 +193,22 @@ private static TimestampedFuture create(Instant t,
Future<Value> f) {
this.outputSchema = outputSchema;
this.defaultTimezone = defaultTimezone;
this.verifyRowValues = verifyRowValues;
+
+ PreparedExpression exp = prepareExpression(sql, nullParams, inputSchema,
defaultTimezone);
+
+ ImmutableList.Builder<Integer> columns = new ImmutableList.Builder<>();
+ for (String c : exp.getReferencedColumns()) {
+ columns.add(Integer.parseInt(c.substring(1)));
+ }
+ this.referencedColumns = columns.build();
+ this.fieldAccess =
FieldAccessDescriptor.withFieldIds(this.referencedColumns);
+
+ exp.close();
Review comment:
Done.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 649537)
Time Spent: 1h 10m (was: 1h)
> Annotate field access in SQL DoFns.
> -----------------------------------
>
> Key: BEAM-12691
> URL: https://issues.apache.org/jira/browse/BEAM-12691
> Project: Beam
> Issue Type: Improvement
> Components: dsl-sql
> Reporter: Kyle Weaver
> Assignee: Andrew Pilloud
> Priority: P2
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> Use the @FieldAccess annotation in SQL DoFns. BeamCalcRel and
> BeamZetaSqlCalcRel are the DoFns that SQL uses to do projects, so these are
> likely the ones we'll need. @FieldAccess will unlock optimizations such as
> BEAM-4457 once they are available.
> cc: [~apilloud]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)