You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Beam JIRA Bot (Jira)" <ji...@apache.org> on 2021/05/31 17:20:02 UTC

[jira] [Commented] (BEAM-11930) Alias name not taking effect in a "over window" query with Beam SQL

    [ https://issues.apache.org/jira/browse/BEAM-11930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17354565#comment-17354565 ] 

Beam JIRA Bot commented on BEAM-11930:
--------------------------------------

This issue is P2 but has been unassigned without any comment for 60 days so it has been labeled "stale-P2". If this issue is still affecting you, we care! Please comment and remove the label. Otherwise, in 14 days the issue will be moved to P3.

Please see https://beam.apache.org/contribute/jira-priorities/ for a detailed explanation of what these priorities mean.


> Alias name not taking effect in a "over window" query with Beam SQL
> -------------------------------------------------------------------
>
>                 Key: BEAM-11930
>                 URL: https://issues.apache.org/jira/browse/BEAM-11930
>             Project: Beam
>          Issue Type: Bug
>          Components: dsl-sql
>            Reporter: Tao Li
>            Priority: P2
>              Labels: stale-P2
>
> The problem is that I don’t see the alias column “agg” in the query result's schema. 
> This is my code (with Beam 2.28):
>  {noformat}
>         Schema appSchema = Schema
>                 .builder()
>                 .addInt32Field("foo")
>                 .addInt32Field("bar")
>                 .build();
>  
>         Row rowOne = Row.withSchema(appSchema).addValues(1, 1).build();
>         Row rowTwo = Row.withSchema(appSchema).addValues(1, 2).build();
>  
>         PCollection<Row> inputRows = pipeline
>                 .apply(Create.of(rowOne, rowTwo))
>                 .setRowSchema(appSchema);
>  
>         String sql = "SELECT foo, bar, RANK() over (PARTITION BY foo ORDER BY bar) AS agg FROM PCOLLECTION";
>         PCollection<Row> result  = inputRows.apply("sql", SqlTransform.query(sql));
>  
> {noformat}
> The Beam schema of the query result is below. Row name is "w0$o0" instead of my specified name "agg".
>  
> Field{name=foo, description=, type=FieldType{typeName=INT32, nullable=false, logicalType=null, collectionElementType=null, mapKeyType=null, mapValueType=null, rowSchema=null, metadata={}}, options={{}}}
> Field{name=bar, description=, type=FieldType{typeName=INT32, nullable=false, logicalType=null, collectionElementType=null, mapKeyType=null, mapValueType=null, rowSchema=null, metadata={}}, options={{}}}
> Field{name=w0$o0, description=, type=FieldType{typeName=INT64, nullable=false, logicalType=null, collectionElementType=null, mapKeyType=null, mapValueType=null, rowSchema=null, metadata={}}, options={{}}}
>  



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